Page 1 of 1

Resizing Huge Image

Posted: 2009-04-20T09:33:24-07:00
by G4XTR
Hi Guys,

I need some help; I'm trying to resize images with sizes of ~10GB using the convert -resize command.

The resize value is quite small, so the output file size isn't much different than the original image.

This all works out fine, however, it takes muuuch too long to complete the process; I'm therefore looking for ways to reduce the processing time. Apart from hardware upgrades, what would you recommend among these options:

- Use different File Format for Resizing? (Currently using .jpg, .png for example was much slower)
- Use a different Software for the resizing?
- Mogrify vs Convert?
- Is there a command to join multiple images slices together into 1 single image?
(Original image could be sliced up and resized individually to save memory)

Any help appreciated

Re: Resizing Huge Image

Posted: 2009-04-20T10:42:24-07:00
by fmw42
try

convert -resize WxH inputimage outputimage

For very large images, see
http://www.imagemagick.org/Usage/files/#massive

For separating the image and then putting it back:

to separate see -crop
http://www.imagemagick.org/Usage/crop/

to join together see either montage or append
http://www.imagemagick.org/Usage/montage/

Re: Resizing Huge Image

Posted: 2009-04-20T13:07:25-07:00
by G4XTR
great help. thanks

Re: Resizing Huge Image

Posted: 2009-04-26T22:03:23-07:00
by anthony
It may be that the raw image data (from stream) could be filtered to say only output every 4 pixel on every 4th row to cut the image size by 1/16 before reading it into convert!

Actually the JPG library using the -size hint does something very similar. If you large image is JPEG you can just use -size hint yourself. See... the last bit in
http://www.imagemagick.org/Usage/thumbnails/#profiles
just before the next section on "General Thumbnail Creation"

Once you have a smaller easier to manage image, you can then resize normally to the final size.

Re: Resizing Huge Image

Posted: 2009-04-27T06:13:28-07:00
by G4XTR
Thanks Anthony,

If I'm getting this right, your solution would be to read just what is required for the result, thereby stripping it from any useless information to save memory.

Problem in this case is that the initial 200cm+ image needs to be adjusted only by around 1,2 cm, so not much different than the original image size.

Re: Resizing Huge Image

Posted: 2009-04-27T21:07:47-07:00
by anthony
A lot of resize methods will generaly produce a blury result for very small resizes like that.
Cropping may work a lot better in such a situation. But it depends on just what the image is.