Hello
I want to use IM to separate an RGB image into three greyscale images, resize the channels independently and then recombine them. I'd like to do it in one command line if possible. Is it possible to select that the -resize operator only applies to a selected one of the images?
For example, using an imaginary operator "-select":
convert foo.jpg -separate -select 1 -resize 100x100 -select 2 -resize 150x150 -select 3 -resize 200x200 -combine foo2.jpg
thanks...
Operate on just one image in an image list?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Operate on just one image in an image list?
you can use clone and parenthesis processing (see http://www.imagemagick.org/Usage/basics/#image_seq )
BUT you cannot recombine (-combine) the images if they are not the same size. So you would have to pad them back to the same size first.
convert zelda3.png -separate \
\( -clone 0 -resize 75% -gravity center -background black -extent 128x128 \) \
\( -clone 1 -resize 50% -gravity center -background black -extent 128x128 \) \
\( -clone 2 -resize 25% -gravity center -background black -extent 128x128 \) \
-delete 0-2 -combine zelda3_tmp.png
BUT you cannot recombine (-combine) the images if they are not the same size. So you would have to pad them back to the same size first.
convert zelda3.png -separate \
\( -clone 0 -resize 75% -gravity center -background black -extent 128x128 \) \
\( -clone 1 -resize 50% -gravity center -background black -extent 128x128 \) \
\( -clone 2 -resize 25% -gravity center -background black -extent 128x128 \) \
-delete 0-2 -combine zelda3_tmp.png
Re: Operate on just one image in an image list?
Lovely. Thankyou.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Operate on just one image in an image list?
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/