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?
Problem with -size and -resize and tiff
Re: Problem with -size and -resize and tiff
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
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
another Problem, my Images are now all only 72dpi. How can i hold my dpi Value? The dpi changes from Image to Image
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Problem with -size and -resize and tiff
I guess you will have to reset it with -density
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Problem with -size and -resize and tiff
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.
Also see Image Padding in Thumbnails for information on sizing an image to fit a specific 'area'.
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
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/