Modifying partially a list

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
jpiquemal
Posts: 54
Joined: 2003-12-07T01:57:19-07:00

Modifying partially a list

Post by jpiquemal »

Hello
I have a list (Image*), containing the same image with different sizes.
How can i modify only one image ?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Modifying partially a list

Post by fmw42 »

see parenthesis processing and -clone, -delete etc at http://www.imagemagick.org/Usage/basics/#image_seq
jpiquemal
Posts: 54
Joined: 2003-12-07T01:57:19-07:00

Re: Modifying partially a list

Post by jpiquemal »

thank you
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Modifying partially a list

Post by anthony »

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/
jpiquemal
Posts: 54
Joined: 2003-12-07T01:57:19-07:00

Re: Modifying partially a list

Post by jpiquemal »

I use the C API.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Modifying partially a list

Post by anthony »

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).
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply