Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Java/Cocoa save PNG file differences -- More.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Java/Cocoa save PNG file differences -- More.




The difference is that the 10.4 version contains an Embedded ICC Profile whereas the 10.3 version just has a (gAMA) defined as 0.55556. I use the following code to create the file:


public void write(NSImage image, String fileName) {
NSBitmapImageRep bmir = new NSBitmapImageRep(image
.TIFFRepresentation());
NSData data = bmir.representationUsingType (NSBitmapImageRep.PNGFileType, null);


        fileName += ".png";
         try {
            URL f = new URL("file://"+fileName);

            data.writeToURL(f, false);

        } catch (MalformedURLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

Is there anyway to control the way OSX writes PNG files (from Java) and/or the color profile ?




On Jun 20, 2005, at 7:26 AM, String Larson wrote:


Apologies in advance for the cross-post.

Attached are two PNG files. Both created with the same code running Java 1.4.2. One running on OSX v10.3.9, the other on v10.4.1.

10.3.9:

<601-10.3.9.png>
104.1:

<601-10.4.1.png>

Ultimately, these get converted to SWFs and imported to a Flash UI. The problem with the 10.4.1 file is that the alpha appears messed up when the image is overlaid in Flash. The 10.3.9 version is fine.

I've searched the archives related to the Red/Blue swap problem but found no answers.

Is anyone from Apple listening ?


_______________________________________________ Do not post admin requests to the list. They will be ignored. Java-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Java-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Java/Cocoa save PNG file differences (From: String Larson <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.