Converting RGB to DNG without affecting color profiles

Hi guys
I'm working with the DNG SDK in C++ for some time now.  I need to be able to take a raw RGB (not camera raw) and convert it into a dng file.  After playing arond with it for a few days, I realized creating the camera profile drastically affects the resulting dng image.
I can't seem to produce a dng file that was identical to the input source.  My picture appears very washed out and I end up using the adobe color profiler to try to bring the image back close to it's original color.
I'm trying to find a way to produce dng files without the need to affect the colors in any way, the resulting picture should be bit identical to that of the raw RGB input file.
I'm not even sure if I can do this considering the usage of the dng format.
UPDATE
I've realized that my program is loading the RGB buffer into the fData of the stage3 image object.  I have a feeling I need stages1 and 2 but i'm unsure if I need to and if so, then i will probaby need a source DNG to produce those stage1 and stage2 unless I can get stage1 or 2 from stage 3 (appears it works vice versa).
I'm able to do the reverse (DNG to RGB raw) by extracting the buffer from the stage3 render.  but in this case, all the metadata has been filled in by the input DNG. However, going from RGB to DNG, I don't have the metadata to fill into stage 1 and 2.

My understanding of the JPG is only middling. I thought I understood that it uses anchor pixels and either a translation table of some sort or difference mapping, using 8 bits per piece of information.
If that were the case, surely changing the translation from CMYK to RGB would be fairly simple.
In this case, the usage is Ebay and they only accept JPG, PNG (and maybe BMP and GIF, I didn't look that closely), but require RGB. I was actually quite surprised to find that JPG allows CMYK since, as you say, anyone dealing with CMYK is going to be dealing with commercial printing and few people who deal with commercial printing would play around with JPG.
I always stick to TIFF or PSD for workflow, but JPG is popular for a reason - when it comes to web, JPG is the only format that can deliver manageable file sizes with full-screen or "large" images for web. Our top level banner photo is 2590x692 and needs to be under 400kb for sane download speeds. PNG couldn't touch that. Even with the aforementioned 1800x1200, PNG is nearly 2mb, while I can maintain very decent quality with a 500kb file with JPG that works well for 'zoom in' type usage.
So there's no way around JPG. It's just annoying that the first person to touch a random selection of the pics was primarily an Illustrator user and saved *some* of the pics in CMYK mode.
It's like that old story about the farmer who didn't want anyone to steal his watermelons, so he cleverly posted a sign "None of these watermelons are poisoned", only to find a note the next day saying "Now, One of these watermelons is...".
Far more work to fix 'some' of the images compared to just doing it right the first time.
But then again, for workers like that, if you can't trust them with an easy job, you could hardly trust them with more complicated jobs...

Similar Messages

  • Converting RGB to CMYK without flattening

    So I made a big mistake and designed something for a client in RGB format Theres only 2 layers out of 14 with colour so how do I go about changing the whole document to CMYK without flattening the document? Or are there any other alternatives?
    Thanks

    When you choose Image > Mode and check CMYK you will be presented with this optioin:
    Having written that, I suggest you check with your client or client's lithographer. He may prefer to do the RGB-to-CMYK conversion himself so that it accommodates his print profile,

  • IWeb 08 screws my photos color profile

    Anyone has this problem with the new iWeb 08?
    I installed the new version, ran it without any problems, did some rearranging of my site, created a new page etc.. And then published the whole site all over again.
    But now, all my images are tagged with the sRGB profile instead of the profile that was in the images.. now all my images have become very saturated and dark. The thumbnails are fine, but when you click in to see the photos in slideshow or not, the images are loaded and it looks horrible.
    I've went into my iDisk to check the images and found that all my photos are tagged with the sRGB profile instead of my normal AdobeRGB profile or Nikon sRGB profile or no profile...
    ARGH!!!!

    iWEB 08 is a fully color confused application, whilst iPhoto is only partly color confused.
    The following applies when dragging images from iPhoto library, with the "Optimize Images on Import" option on. According to the manual, this option only changes the size, but I would not be surprised if it changes something else also. Then after, exporting from iWEB to files on the hard drive.
    Having spent 8 hours analyzing the problem, I am beginning to understand what is happening but certainly not WHY???
    iWEB appear to convert the images 2 times (when importing and when exporting I wonder), both times incorrectly, and to top it off, it exports images without a color profile BUT with the EXIF data of the original, which at this point is incorrect. HOWEVER, it appears that thumbnails are only converted incorrectly once, adding to the confusion.
    Before going into some remedies let me answer the question: What color space etc. is "correct" for the WEB?
    There are three rules to publishing photos on the WEB (files for download is a different story):
    a) Image, including thumbnails should be in sRGB color space (Otherwise it will NOT display correctly on MicroSoft systems, where browsers happily ignores color profiles and sRGB is ASSUMED for all images)
    b) There should be an sRGB color profile in the image file, including thumbnails (Otherwise it will NOT display correctly on MacOS, where browsers assume AppleRGB, but will happily adjust to any color profile)
    c) Discard unnecessary information in the file to reduce size, such as EXIF information, thumbnails etc (optional rule)
    Having said that, you may ask yourself, who do that? Well to tell the truth, not many. A quick check on Apples website reveals that there is a mix of color "strategies". For instance, the pictures demonstrating the cool features of iLife08, appear to be in sRGB but without color profile. Thus, they will be displayed correctly on a MicroSoft system but not on a Mac.
    Well, back to iWEB - To try to fix the color problem, do one or both of the following:
    1) Keep calling Apple Cupertino until they fix the problem (really, I am not joking, I am tired)
    2) Convert images after they have been exported. This seems to work also, almost. However, converting a pictures color space is not exactly reversible, thus result is not perfect. Use for instance Photoshop CS1 or later (make sure color settings is such that there are no conversions when you open files and use the colorimetric conversion option in advanced settings) and:
    a) Open picture
    b) Assign AppleRGB profile
    c) Convert to sRGB
    d) Assign the original profile (usually sRGB or AdobeRGB or the cameras RGB)
    e) Convert to sRGB
    f) Save (with option: include color profile)
    File is now about 2 times the original
    g) Open graphics converter
    h) Choose convert...
    i) Choose file(s), hold Cmd-key and choose remove resources (which does not remove the color profile)
    File is now ok for publishing on the WEB
    TIP, if it seems like a daunting task to manually convert all of the exported images (and do not forget the thumbnails), make an Action-script in Photoshop, then use the Batch feature with sub-folders etc .... . Also the graphics converter operation can be applied to include subfolders. I did this, and it works ok, but be sure to only convert YOUR images, not the other files in the structure. I also applied the same conversion to the thumbnails to simpify things and it turned out not to bad. (Can somebody make an AppleScript maybe?)
    And finally, how about iPhoto? Well, iPhoto will always export images in the color space and profile it happens to be imported with, unless you edit the image in some external editor. If you are WEB publishing "lucky", the image will come out in sRGB color space and with an sRGB color profile. And yes, I have also tried various iPhoto-WEB export plug-ins, and they also all do it wrong.
    If you read all of this, you are a patient person. Thanks for the attention.
    Tomas Jonsson, Genicore Embedded Systems AB

  • Color profiles for I photo books

    Is there a desired color profile to use for printing books with i photo
    My images are currently adobe-rgb. jpegs brought in from CS
    When I print the images thru CS they look great.
    When i print them thru I photo book or the PDF they look very dark and muddy...and would assume the same of the book printing online.
    any ideas on how to get the best print.
    Is there a color profile availabe from the online book printers or are we just winging it
    Also tried converting one page to S-RGB Still Muddy / dark thru i photo book
    and PDF Print. And just fine thru CS
    Any Ideas??
    Thank you

    I guess I am going to throw caution to the wind and see what happens.
    Only one way to find out, Right
    Though I did go back and lighten my images. Also
    Ran color synch utility, which fixed 11 corrupt color profiles.(none of the 11 profiles pertained to i photo)
    I guess I am afraid to use pref setter,, to set the key embed color profile.
    Confused as to what that means??? Does that mean that all my CS Adobe-RGB jpegs will keep their color profile???
    Also implanted one image as an SRGB vs the rest which will all be AdobeRGB
    Oddly my color management in CS is almost Flawless. Yet, get me out of CS and I am completely lost!!!! Complicated stuff
    Toad, I did want to pass on that AdobeRGB 1998 is a much more robust color profile then SRGB especially when it come to printing on Epson. It might be worth experimenting with and if you really want to get into it there is also
    Pro photo RGB which is Huge color space, but a beast to work with
    Here is a link
    http://www.luminous-landscape.com/tutorials/prophoto-rgb.shtml
    Will report back on my book
    TF

  • How to associate color profile to pictures?

    I am importing under LR thousands of scanned slides, that came out of the scanner in RAW format without a color profile associated. Therefore I need to tag them with the scanner color profile (which I have). Is there any way to do it with LR? More specifically, to do it while importing the photos? Otherwise I plan to use a Photoshop action from Photoshop...

    Raw files from Scanners are not Camera Raws. LR is unlikely to read them. Best to use a scanner software like VueScan which can give you a DNG file or TIFF and have the scanner software tag the profile.
    At least thais is as I have read it in other much older threads and fron a scanning fiend friend.
    Don
    Don Ricklin, MacBook 2Ghz Duo 2 Core running 10.5.1 & Win XP, Pentax *ist D
    See LR Links list at my
    Blog for related sites.

  • Choosing Color Profiles for Images Created on Film

    I just finished sending feedback to Adobe on one of its tutorials. The following is a copy of my message explaining my present predicament.
    << I have scanned film negatives and positive film transparencies dating back to the 1950's .I was the creator of most of these images but I do not remember the make or model of the cameras I was using at any point in time prior to 1974 and they all lack metadata. Prior to 2000 I used iPhoto and PS Elements for scanning, toning and development. Thus I can only guess what color profile I should use. I want to create TIFFS that will serve a dual purpose: exporting two formats, one for electronic sharing and the other for printing. On the Adobe CC, if I guess wrong, LR 5.6 64bit crashes immediately. Prior stand alone versions of LR and CS6 let you know that you had a color inconsistency, but they did not crash when you had made a wrong choice between srgb and ProPhoto. ACC gives me more options, but no warnings unless I am missing something your Help Files should contain.>>
    David Krupp Win7 64bit
    Chicago, IL 773-281-6278. [email protected]

    I guess I am going to throw caution to the wind and see what happens.
    Only one way to find out, Right
    Though I did go back and lighten my images. Also
    Ran color synch utility, which fixed 11 corrupt color profiles.(none of the 11 profiles pertained to i photo)
    I guess I am afraid to use pref setter,, to set the key embed color profile.
    Confused as to what that means??? Does that mean that all my CS Adobe-RGB jpegs will keep their color profile???
    Also implanted one image as an SRGB vs the rest which will all be AdobeRGB
    Oddly my color management in CS is almost Flawless. Yet, get me out of CS and I am completely lost!!!! Complicated stuff
    Toad, I did want to pass on that AdobeRGB 1998 is a much more robust color profile then SRGB especially when it come to printing on Epson. It might be worth experimenting with and if you really want to get into it there is also
    Pro photo RGB which is Huge color space, but a beast to work with
    Here is a link
    http://www.luminous-landscape.com/tutorials/prophoto-rgb.shtml
    Will report back on my book
    TF

  • Uploading pictures to website, embedded color profile?

    I'm a photographer and I use deviantart.com. I was trying to upload some pictures i had edited in aperture to my website(sarabil1.deviant.com) and it uploaded it the original and didn't have any of the edits i made on it in aperture. i looked in the deviantart faq is this is what i found:
    "One of the main reasons colors change when a piece is submitted because the piece was saved with a color profile embedded. Since browsers cannot read this color profile it will not be displayed along with your image. Re-saving your image without a color profile embedded should rectify this issue. "
    so my question is-how do i save it without a color profile embedded and if i do will my edits show up when i save it or no? thanks!!

    There is a whole lot of this story that is missing both on your workflow as well as deviantart.com's explanation.
    1) Make sure that you are using Export Version not Export Master.
    2) When using export version make sure that you are exporting with/to an sRGB color profile.
    RB
    3) Take a look at my little rant about stuff like this here:
    http://www.rwboyer.com/RBDesign/Blog/Entries/2008/4/16_Color_Management_and_Other_Stupid_InternetTricks.html

  • DNG converter converts RAW  Adobe RGB color profile to ProPhoto ??

    I have a Canon 5D2.  there is an internal switch to shoot RAW files using the Adobe RGB  profile.  when I open a RAW image in CS4, there is no problem.  yet when I open the DNG converted image in CS4, CS4 tells me the image has the ProPhoto color profile.  I can convert back to Adobe RGB, but it adds an extra step and (I think probably) loses information.  I looked for a switch in the DNG converter to speciy the color profile of the converted image, but could not find it.  Any suggestions ?

    Hi, Tom.
    The real issue here is getting accurate color. You can't get accurate color by setting your monitor profile to sRGB. sRGB is a virtual color space that doesn't describe the exact color gamut of any physical device. But, in order to display sRGB or any color space accurately, you need to get a characterization of your monitor.
    Here is an AWESOME way to get access to a colorimeter: http://www.lensrentals.com/rent/pantone-huey-colorimeter Looks like for $32 you can rent this for a week. Go in on this with a friend and profile both of your monitors and hardly pay a thing. If you have a reasonably good quality LCD monitor, this custom profile you make will be fairly accurate for many months. At the very least, this is way more accurate than having no regular calibration at all.
    Hope this helps!
    Bret

  • Converting RGB images (sRGB or Adobe RGB) to 709 color space.

    I'm trying to determine the correct way to convert RGB images (sRGB or Adobe RGB) to 709 color space.  I can't just use the "covert to profile" function to do this because it does not produce results that fall within the 16 to 235 range that 709 dictates.  I've read that you can simply use the "Levels" adjustment and change the output levels to 16 to 235.  While this would clearly compress the luminance to the correct range, I'm not entirely clear if the end result would be a proper conversion (i.e. if color and gamma, for example, would be technically correct.)
    I noticed that converting the profile to "HDTV (Rec. 709)" does alter the image, so I'm wondering what the result would be if I did both this AND used the levels control to compress the output range to 16 to 235.
    Thanks for any feedback on this.

    (1)
    http://en.wikipedia.org/wiki/Rec._709
    (2)
    http://en.wikipedia.org/wiki/Rec._601
    The transfer functions for Rec.709 (1) refer to the range [0..1] or for 8 bits per pixel [0...255].
    It seems that the clipping, black=16 and white=235 has to happen after the application of the
    transfer function. If this should be true, then we don't have a level compression but a level
    clipping at both ends, as already for Rec.601 (2), like here:
    The ICC-Profile HDTV(Rec.709) in Photoshop contains the primaries and the white point
    (both like that in sRGB) and the transfer functions for [0..1], coded by a LUT with high resolution,
    as found by Profile Inspector. There is no clipping.
    By the way, that`s the internal profile name, I don't know the file name of the profile.
    Softproofing, source in sRGB, target HDTV(Rec.709), without clipping:
    With numbers not preserved: no change of the appearance, as expected.
    With numbers preserved: shows the effect of different effective gammas. 
    Your questions are very clear and I'm not sure whether my comments help. The information
    in the internet is not convincing.
    Best regards --Gernot Hoffmann

  • Converting to CMYK color profile (for print) in raw format

    I am looking to self publish a cookbook in lightningsource. They need the photos in cmyk format. When is it best to convert to this color profile from rgb?
    I have bridge CS5
    What I'm doing currently:
    I click on my .arw image file and select "open in camera raw" which brings me to an editing screen. At the very bottom is says rgb, and 240 ppi
    I need 300 ppi at least and cmyk color.
    Now I know how to change these things in Photoshop, but I was taught that editing it in camera raw in bridge is better to preserve quality for print.
    Should I just edit it in raw and then convert to 300 dpi and cmyk color in photoshop? Or is there a way to do this in bridge? Whats the difference? Any advice will help, trying to make my pictures look amazing in print

    Correct me if I misunderstood anything!
    You are on the right track except for the ppi story. The ppi settings just are a figure expressing the amount of pixels stored in 1 inch, without the width and height figures of the image itself you can't do much with it and just changing this figure is not changing the total amount of available pixels.
    For instance create a new document at 300 ppi and use the international paper size A4 (21 x 29,7 cm). The amount of pixels is 2480 x 3508 (roughly the result of an 8 MP dSLR.
    Use the image size option in PS and be sure to not resample (meaning creating new pixels or deleting pixels to alter the original file size that is 24,9 MB). Now change the amount of pixels to whatever you like. If you increase the number the width and height decrease, and vice versa. Yet the amount of pixels and file size stay at 2480 x 3508 and 24,9 MB.
    But with the specs of wanted width and height for the end result of 300 ppi starts making sense.
    For instance you have a image at the size of a post stamp and an image at international paper size (A4) and both are 300 ppi. The small post stamp size would be in cm about 2 x 3,5 while the A4 size has about 21 x 30 cm width and height.
    So you can imagine having both needed to be printed at the A4 size in 300 dpi (printers work with dots, hence they use dpi - dots per inch- and while not the same they both often use the 300 figure and stand for pretty high quality result) the A4 sized original will meet the wanted standards without problems   while the post stamp would have to be resampled to the new A4 size and when having still 300 ppi needed there would be a lot of interpolation (creating new pixels to match the new size) and this would often result in pixelated or worse quality print result, because PS has to use guess (albeit quit educated guessing) work to add more pixels that are needed to reach the new dimensions.
    ACR has the advantage to set the ppi by default at 300 but as said, as long as you don't alter width and height of the original it is just a figure without any significant importance until you know the complete specs for the output source.

  • LR 4.2 convert or embed color profiles?

    Costco print services use Dry Creek Photo profiles.  They ask that files be converted to color profiles  in PS and say that embedded profiles will be ignored by their digital printers. I wonder if I can do this in LR4.2 without going to PS CS6.
    In Lightroom 4.2, we can choose color profiles in the print module or in the export dialog.   Do you know whether specifying a color profile in these will result in a converting or embedding of those files?  
    Thanks,
    Bill Twieg
    Windows 7

    Thanks Andrew, that was my undertstanding as well – Also for pointing out that the Noritsu and Frontier printers have areas that are outside the sRGB gamut. For anyone interested you can create the 3D wire models here:
    http://www.drycreekphoto.com/tools/printer_gamuts/gamutmodel.html
    You'll need to download a VRML plugin to use it. Here's one of the Costco profiles showing the area that falls outside the sRGB gamut:
    You can see an area in the Green (-a) region that falls outside the sRGB gamut, which will not render properly if you send sRGB profiled files (i.e. Export from LR's ProPhoto RGB to sRGB) to Costco.
    Here's my take on Costco's Noritsu & Frontier printer workflow.
    Normal processing is with Auto Correct ON, which expects sRGB profiled images with no adjustments. With Auto Correct ON the sRGB image is converted by the printer using the printer profile for the selected paper type. It apparently also applies some kind of Auto Contrast and perhaps Auto Color Correction for white balancing. This analysis is based purely on print results obtained using standard sRGB images with Auto Correct ON.
    With Auto Correct OFF the printer does not apply any Contrast or Color correction and a printer profile is not applied to the image. If this is correct then it is absolutely necessary to "convert" your images to the Costco printer profile for the target paper type after making your Soft Proof adjustments. You should also preview different rendering intents in Soft Proof as outlined on the Dry Creek website. PS has more options using 'Customize Proof Condition' than available in LR.
    The best analogy I can think of is Auto Correct On = "Managed By Printer" and Auto Correct OFF = "Managed By Application" (i.e. PS or LR).
    I'll try to verify this with my local Costco Photo Lab manager.

  • Convert Colors profile to threshold to black? [A9]

    Is there a reasonable way to create a color profile that can be used with Convert Colors to apply a threshold (180/255) function to convert an RGB PDF into a black-and-white PDF? Acrobat 9 (CS5), OSX 10.6.7.
    I have some multipage PDF files I want to "sharpen" (make clearer) before printing, and found that opening a page in Photoshop and applying Image > Adjustment > Threshold to 180 (out of 255) does a nice job. This is a pain for multipage PDFs because I have to extract the pages from Acrobat, apply a batch action in Photoshop, and then (potentially) re-integrate them into a PDF file.
    Acrobat can apply ICC profiles to convert an image via Advanced > Print Production > Convert Colors. But how can I generate an ICC profile that does something analagous to the threshold function?
    One crummy way is in Photoshop. Edit > Color Settings, which allows you to define a custom CMYK profile. Under Dot gain, you can set transfer function curves for C,M,Y, and K. I tried doing that, with curves at zero up until 70%, at which point I ran them straight up to 100% with a very steep (almost vertical slope).Tried a bunch of GCR/UCR/Black conversion settings. I saved the profile so Acrobat could see it. This gave me weird results:
    In Photoshop, it came close to doing what I wanted, but not totally, when I converted the image to that profile. But it wasn't drastically wrong. But when I applied the same profile in acrobat (with Convert Colors), it looked much much worse, with large blocky pixel groups and the document, which was mostly a raster image of text, almost unreadable.
    (Sorry for the lack of screenshots/images -- they're at the office, I'll post them tomorrow...)
    Any tips? Is there a better way to do what I want and apply a simple transform to a PDF file?
    A better tool to create ICC profiles for Acrobat's Convert Colors?
    Am I just using the wrong settings in Photoshop?
    Thanks!

    OK, some more info. So, my PDF contains letter-size pages with 300dpi 8bpp images that are DeviceRGB DCT-encoded (JPEG). Here's how Acrobat displays one of the characters:
    (All those obvious JPEG artifacts which explain why it prints badly and would benefit from processing). It looks pretty much the same in Photoshop (via Edit Image from Acrobat, or opening the PDF file directly). Thresholding it to 180 in Photoshop does a great job:
    For simplicity, I tried to build a Gray profile that did what I wanted. But it looks like Photoshop's gray profiles only let you adjust dot gain and gamma, and neither of those are sufficient to achieve this kind of effect. RGB doesn't let you use curves. So I converted the image to CMYK, and then Edit > Convert to Profile, then choose CMYK and Custom CMYK and define a profile like this:
    with these Curves:
    And it seems to do the right thing when the image is converted to it in Photoshop; not perfect but much better than the source:
    So, back to Acrobat, and apply the profile with Convert Colors:
    basically a disaster. and some very faint jpeg artifacts turn into a big blue rectangle.
    So what to do? Is there a better way to construct these profiles? Or should I give up and use batch operations?

  • 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

  • Smart objects and convert color profile behaviour

    I get different results when converting to the same color profile before and after converting to smart object. Why?
    Do the following:
    1. create a cmyk document with color profile 'Euroscale Uncoated v2' and fill the document with the color 86, 32, 14, 0
    2. change the color profile to 'Euroscale Coated v2' -> the values change to 73, 29, 16, 0, no color change on the monitor
    3. create a smart object -> the values stay the same, no color change on the monitor
    4. create a second document like in step 1
    5. create a smart object -> the values stay the same, no color change on the monitor
    6. now change the color profile to 'Euroscale Coated v2' -> the values stay the same, this time we have a color change on the monitor
    Why don't I get the same result?

    I found this topic looking for an answer to this exact same problem.
    Many of you refer to it as a bug / unexpected behaviour, which i thought it was either. But after some tests, it seems very logical behaviour actually to me now.
    It simply follows the rules in the color settings.
    In "Color Management Policies", when CMYK is set to "Preserve Embedded Profiles", it keeps the CMYK numbers for smart objects. Setting this to "Convert to Working CMYK" would make the color conversion as expected.
    However, i don't think this would be a good idea (depending on your workflow offcourse). For example, pasting a 100K shape from a coated.icc illustrator file into an uncoated.icc photoshop file, as a smart object, would convert the 100K (not keeping the CMYK numbers).
    I guess the workarround with a CMYK smart object into an RGB smart object (or maybe LAB), is ok to use when CMYK to CMYK conversion is really necessary for smart objects.

  • Reduce bit depth or convert color profile first? (best practices question)

    For making final deliverable files from working files, is it best to convert to a new color profile before reducing bit depth? Or vise versa?
    Our working files are 16 bit with the ProPhoto color space. Our deliverable files are 8 bit AdobeRGB tiffs and sRGB jpegs. We convert using relative colorimetric with black point compensation. Does it make a difference which order these changes are made in?
    Thanks in advance for your help!

    A profile conversion recalculates RGB values, so yes, it should be done in 16 bit depth.

Maybe you are looking for