Page 1 of 1

Modifying partially a list

Posted: 2009-06-15T05:51:23-07:00
by jpiquemal
Hello
I have a list (Image*), containing the same image with different sizes.
How can i modify only one image ?

Re: Modifying partially a list

Posted: 2009-06-15T09:37:12-07:00
by fmw42
see parenthesis processing and -clone, -delete etc at http://www.imagemagick.org/Usage/basics/#image_seq

Re: Modifying partially a list

Posted: 2009-06-15T09:47:40-07:00
by jpiquemal
thank you

Re: Modifying partially a list

Posted: 2009-06-15T20:39:32-07:00
by anthony
As you mention (Image *) I gather that you are using an API? Which API?

Re: Modifying partially a list

Posted: 2009-06-15T21:57:06-07:00
by jpiquemal
I use the C API.

Re: Modifying partially a list

Posted: 2009-06-16T00:30:13-07:00
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).