Working with YCrCb

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
drewvy

Working with YCrCb

Post by drewvy »

I need to look at (and alter) the Y, Cr, and Cb values for a given pixel. The only structure I see is PixelPacket with RGB as member variables.

In my code I load an image that is in RGB space and I then call... SetImageColorspace(my_image, YCbCrColorspace); ...to convert it.

I then tried to get the pixel info with this call... pixels=GetImagePixels(my_image,0,loop,my_image->columns,1);

Is there a way to do this with ImageMagick calls?

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

Re: Working with YCrCb

Post by anthony »

you map the image into YCrCb colorspace, the Y will be in the first 'Red' channel and so on. when dinished you can map back into RGB colorspace.

See IM Examples, basics, colorspace
http://imagemagick.org/Usage/basics/#colorspace
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply