Page 1 of 1
Problem with -size and -resize and tiff
Posted: 2008-07-28T05:25:07-07:00
by forenhopper
Hi,
convert.exe img.jpg -resize 354x413 -size 354x413 xc:white -compress LZW -depth 8 -colorspace RGB -type TrueColor result.tiff
I get a Image with 354x307. Thats ok. The image was resized proportional. But i need a Image with the size 354x413 and white Backgroundcolor. Imagick makes only one Imageresize.
Where is my failure?
Re: Problem with -size and -resize and tiff
Posted: 2008-07-28T05:40:45-07:00
by forenhopper
solved the problem by my own:
convert.exe (img.jpg -resize 354x413 ) -size 354x413 xc:white -gravity center +swap -composite -compress LZW -depth 8 -colorspace RGB -type TrueColor img.jpg img.tiff
Re: Problem with -size and -resize and tiff
Posted: 2008-07-28T05:48:25-07:00
by forenhopper
another Problem, my Images are now all only 72dpi. How can i hold my dpi Value? The dpi changes from Image to Image
Re: Problem with -size and -resize and tiff
Posted: 2008-07-28T13:47:59-07:00
by fmw42
I guess you will have to reset it with -density
Re: Problem with -size and -resize and tiff
Posted: 2008-07-28T20:55:34-07:00
by anthony
As you 'swapped' the images, the new canvas image is teh destination and as such it is the one with the meta-data that is kept!
Rather than compositing your image onto a canvas, use -extent instead. That will use a 'clone' of the original image for the canvas and thus preserve density and other meta-data information.
Code: Select all
convert.exe img.jpg -resize 354x413 \
-background white -gravity center -extent 354x413 \
..... img.tiff
Also see Image Padding in Thumbnails for information on sizing an image to fit a specific 'area'.