简体   繁体   English

如何快速有效地调整高分辨率tif图像的尺寸?

[英]How to resize high resolution tif images efficiently and quickly?

I am working on a project where I have users uploading print quality high resolution tif images and I need to create a lower resolution web quality preview for the user if/when they come back to view what they uploaded. 我正在做一个项目,在这个项目中,用户上传了打印质量较高的tif图像,如果/他们回来查看上传的内容时,我需要为该用户创建较低分辨率的网络质量预览。

Currently I have a working solution to resize these images using ImageIO.read and ImageIO.write but it is taking up to 15 minutes to modify and save these preview images. 目前,我有一个ImageIO.read解决方案,可以使用ImageIO.readImageIO.write调整这些图像的大小,但是修改和保存这些预览图像最多需要15分钟。 I am wondering if there is a better solution that would take less time to complete. 我想知道是否有更好的解决方案,将需要较少的时间来完成。 Or is this a RAM issue that I am experiencing? 还是这是我遇到的RAM问题?

I'm not sure what libraries you're using, but you can do this in two passes. 我不确定您使用的是什么库,但是您可以分两步进行。 If you're cutting the resolution by half in width and height, then simply take every other pixel and create a quick image from that. 如果要将分辨率降低为宽度和高度的一半,则只需获取其他像素并以此创建快速图像。 It will be low quality, but you should be able to do this very quickly even on large images. 这将是低质量的,但是即使在大图像上,您也应该能够非常快速地执行此操作。 Later, perhaps with a workflow automation system, you can "slow cook" a better-quality derez and take some time to do it well. 稍后,也许使用工作流自动化系统,您可以“慢煮”质量更高的derez,并花一些时间来做好它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM