Splitting a CMYK Image

Discussion in 'Java' started by Oracle3001, Oct 3, 2003.

  1. Oracle3001

    Oracle3001 Guest

    If I have an RGB image, I know I can split it into the 3 grey-scale images,
    by applying the following AND bitwise masking

    int r = (c & 0xff0000) >> 16;

    int g = (c & 0xff00) >> 8;

    int b = c & 0xff;



    If I have an image in CMYK, what is the bitwise AND masking I require to
    extract the 4 greyscale images representing one for each colour?
     
    Oracle3001, Oct 3, 2003
    #1
    1. Advertising

  2. Oracle3001:

    >If I have an RGB image, I know I can split it into the 3 grey-scale images,
    >by applying the following AND bitwise masking

    [...]
    >If I have an image in CMYK, what is the bitwise AND masking I require to
    >extract the 4 greyscale images representing one for each colour?


    That depends on the encoding which was used. Where do you get those
    CMYK samples from?

    Anyway, you could just try a couple of straight-forward encodings,
    e.g.

    cyan = (c & 0xff000000) >> 24;
    magenta = (c & 0x00ff0000) >> 16;
    yellow = (c & 0x0000ff00) >> 8;
    black = c & 0xff;

    Regards,
    Marco
    --
    Please reply in the newsgroup, not by email!
    Java programming tips: http://jiu.sourceforge.net/javatips.html
    Other Java pages: http://www.geocities.com/marcoschmidt.geo/java.html
     
    Marco Schmidt, Oct 4, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. gt
    Replies:
    0
    Views:
    793
  2. Oracle3001

    RGB to CMYK

    Oracle3001, Oct 3, 2003, in forum: Java
    Replies:
    4
    Views:
    8,128
    Tor Iver Wilhelmsen
    Oct 3, 2003
  3. Jason Gastrich, B.A., M.A.

    Changing CMYK to RGB

    Jason Gastrich, B.A., M.A., Nov 5, 2003, in forum: HTML
    Replies:
    13
    Views:
    27,147
    janoonk
    Nov 5, 2008
  4. Andrew Banks

    Setting colour as CMYK not RGB

    Andrew Banks, Mar 5, 2004, in forum: HTML
    Replies:
    1
    Views:
    503
    Chris Morris
    Mar 5, 2004
  5. Johan Holst Nielsen

    Regarding color conversion (RGB->CMYK)

    Johan Holst Nielsen, Nov 12, 2004, in forum: Python
    Replies:
    4
    Views:
    1,895
    Robert Kern
    Nov 13, 2004
Loading...

Share This Page