Question about using GetImagePixels
Question about using GetImagePixels
In RMagick, before I call GetImagePixels and SyncImagePixels I call SetImageType to set the type to TrueColorType. I can't remember why I did this and now I'm wondering if it's necessary. So, should my code ensure that the image is TrueColorType before calling GetImagePixels? What if the image has an alpha channel?
Re: Question about using GetImagePixels
If you are going to introduce new colors into an image it is best to ensure the image is DirectClass before you update the pixels. Call
- SetImageStorageClass(image,DirectClass);
Re: Question about using GetImagePixels
Thanks for your advice! I thought that call looked fishy. I'll make the fix in RMagick asap.