Hello
I have a list (Image*), containing the same image with different sizes.
How can i modify only one image ?
Modifying partially a list
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Modifying partially a list
see parenthesis processing and -clone, -delete etc at http://www.imagemagick.org/Usage/basics/#image_seq
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Modifying partially a list
As you mention (Image *) I gather that you are using an API? Which API?
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Modifying partially a list
I use the C API.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Modifying partially a list
Well in the C API, the Image pointer points into a image linked list. There are functions for selecting images within this list, either doing to the first or last image, or moving forward or backward though the image list.
Most image modification operators only work on the current list being pointed to, and directly modify that image pointer to. That is unlike the command line API, they only do ONE IMAGE, and not the whole list that you give.
So to resize just ONE image, you should be able to just get a pointer to that specific image in the list, and pass it to the operator function.
This does not always work, if the operator askes for a (Image **) then it may want to either delete, or replace the image given, in which case you need to remove that image from the list, do the operation, and put it back into the image list.
Resize for example needs to generate a new image (so it clones the image given, and returns a new one).
Most image modification operators only work on the current list being pointed to, and directly modify that image pointer to. That is unlike the command line API, they only do ONE IMAGE, and not the whole list that you give.
So to resize just ONE image, you should be able to just get a pointer to that specific image in the list, and pass it to the operator function.
This does not always work, if the operator askes for a (Image **) then it may want to either delete, or replace the image given, in which case you need to remove that image from the list, do the operation, and put it back into the image list.
Resize for example needs to generate a new image (so it clones the image given, and returns a new one).
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/