Memory efficient conversion of cmyk jpeg to rgb jpeg

I'm looking for a memory efficient way to convert a jpeg image from cmyk to rgb.
I can't load the whole image in memory. The image is too big (I already have a lot of ram).
Do you know how to do it? Would you share it with us?
At the end of this thread (http://forum.java.sun.com/thread.jspa?messageID=9625078) I show how to do it when loading the whole image in memory. But that's not what I'm looking for. May be you can find a better way to achieve a similar output.

Can you show me how it would look like? 1. SInce CMYK is 4 bytes per pixel the byte array size is w*h*4 which is bigger than w*h*3, so there is no problem to use the same array.
As you can see from this line:raster = Raster.createInterleavedRaster(new DataBufferByte(rgb, rgb.length), w, h, w * 3, 3, new int[]{0, 1, 2}, null);You are passing the size of the array to the DataBufferByte constructor and also to the createInterleavedRaster, so you can use an array with bigger size and just pass w*h*3 instread of rbg.length to DataBufferByte constructor.
2. You can acces the buffer directly instead of using raster.getSamples which creates a new array and places the values in it:
Instead of this:
int c = 255 - C;
int m = 255 - M[i];
int y = 255 - Y[i];
int k = 255 - K[i];
Do this:
int c = 255 - data[i*4];
int m = 255 - data[i*4+1];
int y = 255 - data[i*4+2];
int k = 255 - data[i*4+3];

Similar Messages

  • ICC profile to convert RGB to CMYK,   jpeg is ok, png format have a problem

    When I use ICC profile to convert RGB to CMYK, jpeg format is ok, but png format have a problem.the color is lossy.
    It means, the png file color is shallow than jpeg file after convert.Could anybody help me?
    thanks
    source code
    import java.awt.image.BufferedImage;
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.OutputStream;
    import java.util.Iterator;
    import javax.imageio.IIOImage;
    import javax.imageio.ImageIO;
    import javax.imageio.ImageTypeSpecifier;
    import javax.imageio.ImageWriteParam;
    import javax.imageio.ImageWriter;
    import javax.imageio.metadata.IIOMetadata;
    import javax.imageio.metadata.IIOMetadataNode;
    import javax.imageio.stream.ImageOutputStream;
    import org.w3c.dom.Node;
    import com.sun.image.codec.jpeg.ImageFormatException;
    import com.sun.image.codec.jpeg.JPEGCodec;
    import com.sun.image.codec.jpeg.JPEGEncodeParam;
    import com.sun.image.codec.jpeg.JPEGImageEncoder;
    public class TestImage {
         public static void main(String args[]) throws ImageFormatException, IOException{
              BufferedImage readImage = null;
              try {
                  readImage = ImageIO.read(new File("C:\\TEST.jpg"));
              } catch (Exception e) {
                  e.printStackTrace();
                  readImage = null;
              readImage = CMYKProfile.getInstance().doChColor(readImage);
              writeImage(readImage, "C:\\TEST_after_.jpg", 1.0f);
        protected static String getSuffix(String filename) {
            int i = filename.lastIndexOf('.');
            if(i>0 && i<filename.length()-1) {
                return filename.substring(i+1).toLowerCase();
            return "";
        protected static void writeImage(BufferedImage image, String filename, float quality) {
            Iterator writers = ImageIO.getImageWritersBySuffix(getSuffix(filename));
            System.out.println("filename�F"+filename);
            if (writers.hasNext()) {
                ImageWriter writer = (ImageWriter)writers.next();
                try {
                    ImageOutputStream stream
                        = ImageIO.createImageOutputStream(new File(filename));
                    writer.setOutput(stream);
                    ImageWriteParam param = writer.getDefaultWriteParam();
                    if (param.canWriteCompressed()) {
                        param.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);//NO COMPRESS
                        param.setCompressionQuality(quality);
                    } else {
                        System.out.println("Compression is not supported.");
                    IIOMetadata metadata = null;
                    if(getSuffix(filename).equals("png") || getSuffix(filename).equals("PNG")){
                         ImageTypeSpecifier imageTypeSpecifier = new ImageTypeSpecifier(image);
                         metadata = writer.getDefaultImageMetadata(imageTypeSpecifier, param);
                            String sFormat = "javax_imageio_png_1.0";
                            Node node = metadata.getAsTree(sFormat);
                            IIOMetadataNode gammaNode = new IIOMetadataNode("gAMA");
                            String sGamma = "55556";
                            gammaNode.setAttribute("value", sGamma);
                            node.appendChild(gammaNode);
                            metadata.setFromTree(sFormat, node);
                    writer.write(null, new IIOImage(image, null, metadata), param);
                    writer.dispose();
                    return;
                } catch (IOException ex) {
                    ex.printStackTrace();
    }

    Hi,
    I am having similar problems. I have read somewhere that png format can not handle CMYK colorspace anyway, which I find odd (and plainly stupid IM(NS)HO) which would mean that converting to RGB and therefore using profiles is mandatory.
    May be you should check if the internal format of the png files claims it is RGB or CMYK (using ImageMagick's "identify" command for example).
    HTH
    JG

  • Printing RGB colors - Conversion to CMYK?

    Hi,
    I have been working for a little while in converting my old RGB colors to CMYK printer friendly colors.
    However, I carefully choosed my printing friendly CMYK colors to be as close as possible to the RGB colors but the prints are dull !
    On the other hand, when I print my file withj RGB colors using the PDF Distiller tagged with Adobe1998 profile and send the file to the printer, colors look smarter !
    It means that the CMYK colors I picked myself are not good enough anf the Color Managment in Adobe PDF or Illustrator are better than me ! As follows:
    - In Illustrator -> Print -> Color Management tab -> Color Handling: Let Illustrator determine colors
    - in Acrobat Reader -> Print -> Color Management tab of the plotter: Application managed colors
    Both ouput similar quality prints, and better than my own CMYK colors !
    Are the Application Color Management engines in Illustrator and in Adobe Reader similar in their conversion?
    How can I find out which are the CMYK colors printed when the application (Reader or Illustrator) manages colors, from my initial RGB colors? I would like to use them directly in my document...
    Thanks

    Hi,
    Thanks for your response. I put these color issues on hold because I had no time to search more on that recently...
    However, I have still lots of questions about color conversion!
    When I said "carefully choose" CMYK colors, it means CMYK colors printable and which look similar to my old RGB colors on-screen. But of course, screen is not enough!
    What I noticed is that when I print my old RGB colors (not in printer color space), Adobe Reader or Illustrator were able to make good conversion to CMYK for printing.
    Now, I would like to find out to which CMYK color codes Adobe Reader or Illustrator converted my RGB colors? Then, I would be able to use these CMYK color codes directly in my application...
    Is there any way to find out that?
    Cheers

  • How can I load a CMYK jpeg image

    How can I load a CMYK jpeg image (originally saved from Photoshop) and then
    turn it into an rgb BufferedImage, in order to display it on screen in an
    applet?
    I first tried ImageIO.read(), but that does not work for cmyk jpegs. I then
    looked into the com.sun.image.codec.jpeg package, and tried methods like
    decodeAsBufferedImage() and decodeAsRaster().
    The first one (decodeAsBufferedImage) returned an image, but it seems that
    it was interpreted as an ARGB, and the colors were incorrect.
    I then read the documentation which (amongst many other things) stated that
    "If the user needs better control over conversion, the user must request the
    data as a Raster and handle the conversion of the image data themselves."
    This made sense, so I took to decodeAsRaster(), only to find that I could
    not figure out how to carry out the desired conversion.
    Of course, I have looked into the documentation for BufferedImage, Raster,
    ColorModel, ColorSpace etc, but after a while I was lost. (Before I got lost
    I read that you can convert images with the help of methods like toRGB,
    toCIEXYZ.)
    I have a feeling that this is probably pretty simple if you just know how to
    do it, but I sure would need some directions here.
    Any help would be appreciated. Thanks.

    You can either use the "Place" command from the main menu, under "File", or you can just open it, select the move tool "V", the click in the image and drag it to the other file's tab.

  • Problem displaying CMYK jpeg images

    I have a problem with a CMYK jpeg image.
    I know that about supported JPEGs in JRE - JCS_CMYK and JCS_YCCK are not supported directly.
    And I found here how to load the image:
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4799903
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5100094
    I used both the suggestions described to load it, but when the image is displayed the colors are wrong, are very different from the one displayed in PhotoShop, for example.
    Any suggestion are very appreciated. If it's necessary i can send you the image.
    Roberto
    Here is the code
    package com.cesarer.example.crop;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.io.*;
    import java.util.Iterator;
    import javax.imageio.ImageIO;
    import javax.imageio.ImageReader;
    import javax.imageio.stream.ImageInputStream;
    import javax.swing.*;
    import javax.swing.event.MouseInputAdapter;
    public class CroppingRaster extends JPanel
        BufferedImage image;
        Dimension size;
        Rectangle clip;
        boolean showClip;
        public CroppingRaster(BufferedImage image)
            this.image = image;
            size = new Dimension(image.getWidth(), image.getHeight());
            showClip = false;
        protected void paintComponent(Graphics g)
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            int x = (getWidth() - size.width)/2;
            int y = (getHeight() - size.height)/2;
            g2.drawImage(image, x, y, this);
            if(showClip)
                if(clip == null)
                    createClip();
                g2.setPaint(Color.red);
                g2.draw(clip);
        public void setClip(int x, int y)
            // keep clip within raster
            int x0 = (getWidth() - size.width)/2;
            int y0 = (getHeight() - size.height)/2;
            if(x < x0 || x + clip.width  > x0 + size.width ||
               y < y0 || y + clip.height > y0 + size.height)
                return;
            clip.setLocation(x, y);
            repaint();
        public Dimension getPreferredSize()
            return size;
        private void createClip()
            clip = new Rectangle(140, 140);
            clip.x = (getWidth() - clip.width)/2;
            clip.y = (getHeight() - clip.height)/2;
        private void clipImage()
            BufferedImage clipped = null;
            try
                int w = clip.width;
                int h = clip.height;
                int x0 = (getWidth()  - size.width)/2;
                int y0 = (getHeight() - size.height)/2;
                int x = clip.x - x0;
                int y = clip.y - y0;
                clipped = image.getSubimage(x, y, w, h);
            catch(RasterFormatException rfe)
                System.out.println("raster format error: " + rfe.getMessage());
                return;
            JLabel label = new JLabel(new ImageIcon(clipped));
            JOptionPane.showMessageDialog(this, label, "clipped image",
                                          JOptionPane.PLAIN_MESSAGE);
        private JPanel getUIPanel()
            final JCheckBox clipBox = new JCheckBox("show clip", showClip);
            clipBox.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent e)
                    showClip = clipBox.isSelected();
                    repaint();
            JButton clip = new JButton("clip image");
            clip.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent e)
                    clipImage();
            JPanel panel = new JPanel();
            panel.add(clipBox);
            panel.add(clip);
            return panel;
        public static void main(String[] args) throws IOException
             File file = new File("src/ABWRACK_4C.jpg");
             // Find a JPEG reader which supports reading Rasters.
            Iterator readers = ImageIO.getImageReadersByFormatName("JPEG");
            ImageReader reader = null;
            while(readers.hasNext()) {
                reader = (ImageReader)readers.next();
                if(reader.canReadRaster()) {
                    break;
         // Set the input.
            ImageInputStream input =
                ImageIO.createImageInputStream(file);
            reader.setInput(input);
            Raster raster = reader.readRaster(0, null);
             BufferedImage bi = new BufferedImage(raster.getWidth(),
                    raster.getHeight(),
                    BufferedImage.TYPE_4BYTE_ABGR);
             // Set the image data.
             bi.getRaster().setRect(raster);
            // Cropping test = new Cropping(ImageIO.read(file));
             CroppingRaster test = new CroppingRaster(bi);
            ClipMoverRaster mover = new ClipMoverRaster(test);
            test.addMouseListener(mover);
            test.addMouseMotionListener(mover);
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(new JScrollPane(test));
            f.getContentPane().add(test.getUIPanel(), "South");
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
    class ClipMoverRaster extends MouseInputAdapter
        CroppingRaster cropping;
        Point offset;
        boolean dragging;
        public ClipMoverRaster(CroppingRaster c)
            cropping = c;
            offset = new Point();
            dragging = false;
        public void mousePressed(MouseEvent e)
            Point p = e.getPoint();
            if(cropping.clip.contains(p))
                offset.x = p.x - cropping.clip.x;
                offset.y = p.y - cropping.clip.y;
                dragging = true;
        public void mouseReleased(MouseEvent e)
            dragging = false;
        public void mouseDragged(MouseEvent e)
            if(dragging)
                int x = e.getX() - offset.x;
                int y = e.getY() - offset.y;
                cropping.setClip(x, y);
    }

    The loading process It takes about 10 seconds, and every repaint it takes the same time.The painting yes, the loading no. It shouldn't take much more time to load the image then an ordinary JPEG. In particular, your now using a "natively accelerated" JPEG image reader, so it should take less time on average to load any JPEG. 10 seconds is absurd. Are you sure your not including the drawing time in that figure?
    - Another problem: JAI-ImageIO is not available for MAC OS X platform.This is somewhat true. You can take the imageio.jar file and package it together with your program (adding it to the class path). This will give you most of the functionality of JAI-ImageIO; in particular the TIFFImageReader. You just won't be able to use the two natively accelerated ImageReaders that comes with installing.
    Right now, you're using the accelerated CLibJPEGImageReader to read the image. You can't use this image reader on the MAC, so you have to take the approach mentioned in the 2nd bug report you originally posted (i.e. use an arbitrary CMYK profile).
    The conversion is too long more than 30 seconds.The code you posted could be simplified to
    BufferedImage rgbImage = new BufferedImage(w,h,
                BufferedImage.3_BYTE_BGR);
    ColorConvertOp op = new ColorConvertOp(null);
    op.filter(cmykImage,rgbImage);But again, 30 seconds is an absurd value. After a little preparation, converting from one ICC_Profile to another is essentially a look up operation. What does,
    System.out.println(cmykImage.getColorModel().getColorSpace());print out? If it's not an instance of ICC_ColorSpace, then I can understand the 30 seconds. If it is, then something is dreadfully wrong.
    the RGB bufferedImage that i get after the transformation when it is displayed is much more brightThis is the "one last problem that pops up" that I hinted at. It's because some gamma correction is going on in the background. I have a solution, but it's programming to the implementation of the ColorConvertOp class and not the API. So I'm not sure about its portability between java versions or OS's.
    import javax.swing.*;
    import java.awt.color.ICC_ColorSpace;
    import java.awt.color.ICC_Profile;
    import java.awt.image.BufferedImage;
    import java.awt.image.ColorConvertOp;
    import javax.imageio.ImageIO;
    import java.io.File;
    public class CMYKTest {
         public static void main(String[] args) throws Exception{
            long beginStamp, endStamp;
            //load image
            beginStamp = System.currentTimeMillis();
            BufferedImage img = ImageIO.read(/*cmyk image file*/);
            endStamp = System.currentTimeMillis();
            System.out.println("Time to load image: " + (endStamp-beginStamp));
            //color convert
            BufferedImage dest = new BufferedImage(img.getWidth(),
                                                   img.getHeight(),
                                                   BufferedImage.TYPE_3BYTE_BGR);
            beginStamp = System.currentTimeMillis();
            sophisticatedColorConvert(img,dest);
            endStamp = System.currentTimeMillis();
            System.out.println("Time to color convert: " + (endStamp-beginStamp));
            //display
            JFrame frame = new JFrame();
            frame.setContentPane(new JScrollPane(new JLabel(new ImageIcon(dest))));
            frame.setSize(500,500);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setVisible(true);
        public static BufferedImage sophisticatedColorConvert(BufferedImage src,
                                                              BufferedImage dst) {
            ICC_ColorSpace srcCS =
                    (ICC_ColorSpace) src.getColorModel().getColorSpace();
            ICC_Profile srcProf = srcCS.getProfile();
            byte[] header = srcProf.getData(ICC_Profile.icSigHead);
            intToBigEndian(ICC_Profile.icSigInputClass,header,12);
            srcProf.setData(ICC_Profile.icSigHead,header);
            ColorConvertOp op = new ColorConvertOp(null);
            return op.filter(src, dst);
        private static void intToBigEndian(int value, byte[] array, int index) {
                array[index]   = (byte) (value >> 24);
                array[index+1] = (byte) (value >> 16);
                array[index+2] = (byte) (value >>  8);
                array[index+3] = (byte) (value);
    }

  • 'Convert CMYK Colors to RGB' still runs havoc in 9! (Plus a PDF version problem)

    This post is to warn people about severe issues, and how to avoid them. Issues with the CMYK color setting in FM9.x have been reported here earlier, such as:
    http://forums.adobe.com/message/1237696#1237696
    http://forums.adobe.com/message/1237852#1237852
    http://forums.adobe.com/message/1237165#1237165
    However, I do not think this issue has been warned about anywhere near as much as it should have. And, as usual, Adobe is silent (they should have a big poster on their site warning about this issue! And they have even claimed that patches have "solved" the issues with CMYK).
    Just recently, while experimenting with FM9 again, I had extreme problems, which, at first, seemed totally unrelated to this CMYK setting. But after having struggled extremely hard for many many many hours, I finally found out. Now is the time to inform others:
    First a note about versions: FrameMaker 9.0p237, Acrobat Distiller 9.1, XP SP2
    It looks perfectly okay on screen in FrameMaker, exactly as in FM8. But when saved as pdf, several things are "corrupted". Examples: no kerning after the letter 'T', such as the word 'Text'. Dotted leader for a right aligned tab disappears. Some objects from the master pages, such as a logo, become enclosed in a rectangle (a border of the frame/object), but it only happens on *some* body pages, whereas other body pages using the same master page are ok!!? Equations are formatted differently from the way they should, with the wrong font for number, etcetera.
    Solutions:
    1. When 'Save as PDF...', untick 'Convert CMYK Colors to RGB' in PDF Setup. Same setting is in the file's 'Format > Document > PDF Setup...'
    A drawback with this method is that, as of Acrobat Distiller v9, it does not seem to respect the pdf version specified in the PDF job Options! I get PDF 1.6 with this method, despite my job option specifies version 1.5. (This happens also with FrameMaker 8 if Acrobat is v9.) So you *have* to optimize it in Acrobat in order to get a web friendly PDF (PDF 1.4 or 1.5).
    or
    2. Print to 'Adobe PDF'.
    In this latter case, you can set the same 'PDF Setup' settings under the button 'Setup...', EXCEPT that there is no tick box for 'Convert CMYK Colors to RGB', and it does not matter what setting you have chosen in the file's 'Format > Document > PDF Setup...', it will be RGB conversion in any case. Make sure that after you exit the setting, the tick box for 'Print to File' is NOT ticked! This method respects the pdf version specified in the PDF job Options! I get PDF 1.5, which is what my job option specifies.
    (For some reason, Acrobat/Reader does not render these two PDFs exactly the same, except in extreme magnification! Maybe it has to do with the different PDF versions of the files.)
    In either case, the solution actually solves ALL problems I listed! Despite it seems to have absolutely nothing whatsoever to do with colors! Some day in the distant future, CMYK might actually work! But, for myself, I would prefer a proper color management instead...
    Best Regards,
      /Harald

    Oops!! Not until now I discover that under 'Solutions' I happened to write 'untick' where it should be 'tick'! I.e, colors SHOULD be converted to RGB in order to circumvent the problems! I.e it runs havoc in v9 when CMYK colors are NOT converted to RGB! Don't know how I came to write the opposite, but probably I started out by describing the situation where the problems are seen rather than describing how to avoid them.
    Equally strange is that nobody corrected me, but perhaps the mistake was so obvious? (But whether you see problems or not might depend on what fonts you use. So, under certain special circumstances, CMYK might actually work without these reported problems.)
    I am also a bit surprised that others haven't reported the issue that the PDF version set in PDF job Options isn't respected when using 'Save As PDF' and Acrobat 9? (Or maybe someone has, but I have missed it.)

  • Memory Efficiency of BufferedImage and ImageIO

    This thread discusses the memory efficiency of BufferedImage and ImageIO. I also like to know whether if there's possible memory leak in BufferedImage / ImageIO, or just that the result matches the specifications. Any comments are welcomed.
    My project uses a servlet to create appropriate image tiles (in PNG format) that fits the specification of google map, from images stored in a database. But it only takes a few images to make the system out of heap memory. Increasing the initial heap memory just delays the problem. So it is not acceptable.
    To understand why that happens, I write a simple code to check the memory usage of BufferedImage and ImageIO. The code simply keeps making byte arrays from the same image until it is running out of the heap memory.
    Below shows how many byte arrays it can create:
    1M jpeg picture (2560*1920):
    jpeg = 123
    png = 3
    318K png picture (1000*900):
    jpeg = 1420
    png = 178
    Notice that the program runs out of memory with only 3 PNG byte arrays for the first picture!!!! Is this normal???
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.awt.geom.*;
    import javax.imageio.*;
    import java.io.*;
    import javax.swing.*;
    import java.util.*;
    public class Test {
         public static void main(String[] args) {
              Collection images = new ArrayList();
              for (;;) {
                   try {
                        BufferedImage img = ImageIO.read(new File("PTHNWIDE.png"));
                        img.flush();
                        ByteArrayOutputStream out =
                             new ByteArrayOutputStream();
                        ImageIO.write(img, "png", out); // change to "jpeg" for jpeg
                        images.add(out.toByteArray());
                        out.close();
                   } catch (OutOfMemoryError ome) {
                        System.err.println(images.size());
                        throw ome;
                   } catch (Exception exc) {
                        exc.printStackTrace();
                        System.err.println(images.size());
    }

    a_silent_lamb wrote:
    1. For the testing program, I just use the default VM setting, ie. 64M memory so it can run out faster. For server, the memory would be at least 256M.You might want to increase the heap size.
    2. Do you mean it's 2560*1920*24bits when loaded? Of course.
    That's pretty (too) large for my server usage, Well you have lots of image data
    because it will need to process large dimension pictures (splitting each into set of 256*256 images). Anyway to be more efficient?Sure, use less colors :)

  • Export PNG in CMYK vs. RGB. Changing colors.

    Short version: Using Illustrator CC. I correctly exported a PNG logo in RGB (sent to client), but the new PNG logo looks much different than the old PNG logo that was exported incorrectly in CMYK (sent to client long ago).
    Client wants to know why the NEW PNG logo looks so different than the EPS logo and the OLD PNG logo (all starting with the same Pantone color).
    Longer version:
    I recently sent logos to my client in different formats.
    ai, eps, eps CMYK, pdf, and png
    Prior to creating the PNG version in Illustrator CC,
    I changed Illustrator's color mode to RGB, then converted my Pantone colors to RGB (specific values per the Pantone book), then exported as PNG.
    This created a much different blue than the CMYK eps version.
    Someone else on the client side is working with my files and questioning why the blues look so different. The Pantone eps vs. the RGB version.
    Problem:
    In the past, the PNGs had been created incorrectly--They had been exported in CMYK mode without converting anything to RGB and they matched much closer to the EPS version.
    Now they are asking why there is such a big difference.
    I did the process correctly, I'm not sure how to answer this. Why do they look so different?

    So if I just leave the Document Color Mode as CMYK, leaving with the logo set in it's specific Pantone colors, and then Export/PNG, that will covert my CMYK colors to RGB for me. Seems almost too easy. Just go File/Export/PNG, but okay.
    And while that may give me a better perceptual match, here's the other side of the issue.
    They've given me and their web company specific RGB values for their logo. These are based on the Pantone book, and likely different than the conversion Illustrator will do.
    The idea being, they want the website and logo to be the exact same blue. And they are based on the values they gave, but they look different than the original Pantone. Brighter and more vibrant. I'm dealing with another member of the client team, trying to use Illustrator on her end for smaller tasks, and she wants to know why the rgb PNG logo (which I entered in manual values for based on the Pantone book), is so different than the Pantone eps file. In the past, when I just exported as a straight PNG without tinkering, the perceptual match was there. Now it isn't. How can I explain this?

  • Preview - saving resized CMYK JPEGs

    I can't save a resized CMYK JPEG with Preview:
    Take a JPEG, any JPEG.
    Duplicate it, make an RGB and a CMYK version (create whichever one did not already exist) using
    GraphicConverter or a similar tool.
    Open each in Preview and use "Adjust Size..." to adjust the resolution.
    Save. RGB version saves fine. CMYK version fails with "The document 'CMYK.jpg' could not be saved."
    Can anyone confirm or deny?

    Just been bitten by the same problem. It seems to work fine on Leopard but seems broken in SL?

  • PLEASE HELP!!! URGENT!!!! convert a jpg CMYK to jpg RGB

    Hello i need to convert to image jPG CMYK to jpg RGB..y try with this code:
    <code>
    RenderedOp image = JAI.create("fileload", "C:/Documents and Settings/rsornes/Desktop/Imagenes/fondo grde con simb_copei.jpg");
    JAI.create("filestore", convertCMYKtoRGB(image), "C:/Documents and Settings/rsornes/Desktop/001.jpg", "JPEG", null);
    .....>
    public static RenderedOp convertCMYKtoRGB(RenderedOp op) {
    try {
    // -- Convert RGBA to CMYK
    // -- because JAI reads CMYK as RGBA
    ICC_Profile cmyk_profile = ICC_Profile.getInstance("C:/Documents and Settings/rsornes/Desktop/jai/CMYK.pf");
    ICC_ColorSpace cmyk_icp = new ICC_ColorSpace(cmyk_profile);
    ColorModel cmyk_cm =
    RasterFactory.createComponentColorModel(op.getSampleModel().getDataType(),
    cmyk_icp,
    false,
    true,
    Transparency.OPAQUE);
    ImageLayout cmyk_il = new ImageLayout();
    cmyk_il.setColorModel(cmyk_cm);
    RenderingHints cmyk_hints = new RenderingHints(JAI.KEY_IMAGE_LAYOUT, cmyk_il);
    ParameterBlockJAI pb = new ParameterBlockJAI("format");
    pb.addSource(op);
    pb.setParameter("datatype", op.getSampleModel().getDataType());
    op = JAI.create("format", pb, cmyk_hints);
    // -- Convert CMYK to RGB
    ColorSpace rgb_icp = ColorSpace.getInstance(ColorSpace.CS_sRGB );
    ColorModel rgb_cm =
    RasterFactory.createComponentColorModel(op.getSampleModel().getDataType(),
    rgb_icp,
    false,
    true,
    Transparency.OPAQUE);
    ImageLayout rgb_il = new ImageLayout();
    rgb_il.setSampleModel(rgb_cm.createCompatibleSampleModel(op.getWidth(),
    op.getHeight()));
    RenderingHints rgb_hints = new RenderingHints(JAI.KEY_IMAGE_LAYOUT, rgb_il);
    pb = new ParameterBlockJAI("colorconvert");
    pb.addSource(op);
    pb.setParameter("colormodel", rgb_cm);
    op = JAI.create("colorconvert", pb, rgb_hints);
    } catch(Exception ex) {
    ex.printStackTrace();
    return op;
    </code>
    With this code work but de image jpg RGB result is not have the same color that of the original jpg CMYK...the image result (jpg RGB ) is very dark is almost black color....please i need urgen to resolve this
    if you kwon whta happends with my code thanks and if exist other code that you have...thanks
    thanks
    Rafael

    I don't know anything about this topic, but I've seen a lot of posts about it.
    http://www.google.com/search?q=convert+cmyk+site:forum.java.sun.com&sourceid=opera&num=0&ie=utf-8&oe=utf-8

  • HELP!!! URGENT!!!! convert a jpg CMYK to jpg RGB

    Hello i need to convert to image jPG CMYK to jpg RGB..y try with this code:
    <code>
    RenderedOp image = JAI.create("fileload", "C:/Documents and Settings/rsornes/Desktop/Imagenes/fondo grde con simb_copei.jpg");
    JAI.create("filestore", convertCMYKtoRGB(image), "C:/Documents and Settings/rsornes/Desktop/001.jpg", "JPEG", null);
    .....>
    public static RenderedOp convertCMYKtoRGB(RenderedOp op) {
    try {
    // -- Convert RGBA to CMYK
    // -- because JAI reads CMYK as RGBA
    ICC_Profile cmyk_profile = ICC_Profile.getInstance("C:/Documents and Settings/rsornes/Desktop/jai/CMYK.pf");
    ICC_ColorSpace cmyk_icp = new ICC_ColorSpace(cmyk_profile);
    ColorModel cmyk_cm =
    RasterFactory.createComponentColorModel(op.getSampleModel().getDataType(),
    cmyk_icp,
    false,
    true,
    Transparency.OPAQUE);
    ImageLayout cmyk_il = new ImageLayout();
    cmyk_il.setColorModel(cmyk_cm);
    RenderingHints cmyk_hints = new RenderingHints(JAI.KEY_IMAGE_LAYOUT, cmyk_il);
    ParameterBlockJAI pb = new ParameterBlockJAI("format");
    pb.addSource(op);
    pb.setParameter("datatype", op.getSampleModel().getDataType());
    op = JAI.create("format", pb, cmyk_hints);
    // -- Convert CMYK to RGB
    ColorSpace rgb_icp = ColorSpace.getInstance(ColorSpace.CS_sRGB );
    ColorModel rgb_cm =
    RasterFactory.createComponentColorModel(op.getSampleModel().getDataType(),
    rgb_icp,
    false,
    true,
    Transparency.OPAQUE);
    ImageLayout rgb_il = new ImageLayout();
    rgb_il.setSampleModel(rgb_cm.createCompatibleSampleModel(op.getWidth(),
    op.getHeight()));
    RenderingHints rgb_hints = new RenderingHints(JAI.KEY_IMAGE_LAYOUT, rgb_il);
    pb = new ParameterBlockJAI("colorconvert");
    pb.addSource(op);
    pb.setParameter("colormodel", rgb_cm);
    op = JAI.create("colorconvert", pb, rgb_hints);
    } catch(Exception ex) {
    ex.printStackTrace();
    return op;
    </code>
    With this code work but de image jpg RGB result is not have the same color that of the original jpg CMYK...the image result (jpg RGB ) is very dark is almost black color....please i need urgen to resolve this
    if you kwon whta happends with my code thanks and if exist other code that you have...thanks
    thanks
    Rafael

    thanks but I need to pass a CMYK to RGB

  • Color correct CMYK Image with RGB Image

    1. anybody please tell me is it possible to perform color correction in CMYK image with RGB reference image
    2. how to do that i mean what are the details i have to watch for?
    ADVANCE THANKS

    Your match using my color profile(similar to North American General Purpose) would be 29c 100m 83y 35k. Convert a sample swatch, using your color workflow/profile.
    Some RGB colors won't convert well to cmyk (eg 0R 255B 0G). In that case your problem is not using a RGB reference image for CMYK color correction, but the cropped color gamut in the color conversion itself.
    In those cases of saturated RGB colors you may have to do some handtoning to surrounding colors, to help create the illusion of RGB saturation to the troublesome color you are matching.

  • FM10 Crashes when Convert CMYK colors to RGB selected

    Hi folks,
    I have searched for info on this issue and found a couple of items but I'm still having problems doing what I need to do.
    First off, FM 10 version is 10.0.2.419. PC is Dell E6420 laptop, Win 7 SP1, 8GB RAM, big hard drive. No existing Adobe software before installing TCS 3.0 from local files (copied from DVD).
    At first I could not create a pdf (using File > Save as PDF) at all on this system (my old XP system still works fine with TCS 3.0). Instant crash and error messages (Internal error 10024, 7687848, 7688138, 10076935.). After reading the discussions, I cleared the check box for Convert CMYK colors to RGB, which allowed me to create the pdf. However, my colors are washed out completely. So I need to be able to select this check box without the crash.
    Any suggestions?
    Thanks!

    (1)     Although FrameMaker 10 is a 32-bit application, there was no issue with it running under Windows 7 64-bit. You certainly don't need to run it under any XP mode!!!!
    (2)     There were any number of save as PDF bugs in FrameMaker 10 that were fixed in various updates, but typically they were associated with when one didn't check that convert CMYK to RGB option (that uses the native Windows GDI for PostScript creation).
    (3)     Rather than printing to File and distilling, try printing directly to the Adobe PDF PostScript printer driver instance.
              - Dov

  • CHANGING DEFAULT CMYK SWATCHES TO RGB

    I've been looking for a way to change the default CMYK swatch to RGB.  I've tried everything.  CMYK colors - even black ARE NOT ACCURATE.  Help?

    you just need to change the profile when creating new document
    CMYK is Accurate, when printing CMYK!
    RGB is Accurate, when displaying in RGB!
    colour is a complex thing.

  • Building Query in Pre-Query. How to make it more Memory Efficient

    Hello all,
    I have a form with 2 Data Blocks.
    First Block is used for giving query Parameters and second one returns the results based on a View.
    I build the Select Clause in the pre-query based on the Parameters. So every time I have a Different Query.
    Could that create problem in the Database Server due to parsing queries again and again?
    Would using a Different approach (i.e. ref Cursors) be more memory Efficient?
    Thanks

    The pre-query is quite Large so I am pasting only a part of the Code (the rest of it Is Identical).
    In the selects v is the alias of the View of the Second Data Block.
    The :qf_ bind variables are fields of the First block where I give the Parameters.
                   IF :QF_IS_DISPLAYED=1 THEN
                   L_WHERE := L_WHERE || ' AND V.IS_DISPLAYED =''1''';
                   END IF;
                   IF :qf_colour IS NOT NULL THEN
                   L_WHERE := L_WHERE || ' AND item_colour=''' ||:qf_colour ||'''';
                   END IF;
         IF :qf_product_item_colour IS NOT NULL THEN
                   L_WHERE := L_WHERE || ' AND product_item_colour=''' ||:qf_product_item_colour ||'''';
         END IF;
         IF :qf_product_length IS NOT NULL THEN
                   L_WHERE := L_WHERE || ' AND product_length=''' ||:qf_product_length ||'''';
         END IF;
                   IF :qf_apf_batch_id IS NOT NULL THEN
                   L_WHERE := L_WHERE || ' AND apf_batch_id=' ||:qf_apf_batch_id;
                   END IF;
                        if :qf_prod_resource is not null then
                        L_WHERE := L_WHERE ||' AND v.resources = ''' ||:qf_prod_resource ||'''';
                        end if;
                        if :qf_customer_number is not null then
                        L_WHERE := L_WHERE || ' AND FACTORY_ORDER_ID IN (SELECT FA.FACTORY_ORDER_ID
                                                                                                                                                     FROM OE_ORDER_HEADERS_ALL OH,
                                                                                                                                                                    RA_CUSTOMERS RA,
                                                                                                                                                                    XXSC_DEMAND_LINES DL,
                                                                                                                                                                    XXSC_FACTORY_ORDERS FA
                                                                                                                                                     WHERE      OH.SOLD_TO_ORG_ID = RA.CUSTOMER_ID
                                                                                                                                                     AND      DL.SOURCE_HEADER_ID = OH.HEADER_ID
                                                                                                                                                     AND          DL.FACTORY_ORDER_ID = FA.FACTORY_ORDER_ID
                                                                                                                                                     AND               RA.CUSTOMER_NUMBER = ''' ||:qf_customer_number ||''')';
                        end if;

Maybe you are looking for