DO NOT REPLY [Bug 47561] New: png color profiles seem to get lost during transfer to PDF

View: New views
7 Messages — Rating Filter:   Alert me  

DO NOT REPLY [Bug 47561] New: png color profiles seem to get lost during transfer to PDF

by Bugzilla from bugzilla@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

https://issues.apache.org/bugzilla/show_bug.cgi?id=47561

           Summary: png color profiles seem to get lost during transfer to
                    PDF
           Product: XMLGraphicsCommons
           Version: Trunk
          Platform: PC
        OS/Version: Windows Server 2003
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Image codecs
        AssignedTo: general@...
        ReportedBy: gd@...


Created an attachment (id=24021)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=24021)
contains png, jpg, fo and pdf file.

I still have a problem when inserting PNG files into a PDF using fop. My PNG
file has a color profile "Dot Gain 15%". The PDF contains the same png file,
but the color profile is suddenly "KODAK Grayscale Conversion - Gamma 1.0".

New information: Converting the PNG file to JPG with ImageMagick (convert
imgTest.png imgTest.jpg) and including the JPG file, the color profile is
retained.

--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@...
For additional commands, e-mail: general-help@...


DO NOT REPLY [Bug 47561] png color profiles seem to get lost during transfer to PDF

by Bugzilla from bugzilla@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

https://issues.apache.org/bugzilla/show_bug.cgi?id=47561


Max Berger <max@...> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|general@.... |max@...
                   |org                         |




--- Comment #1 from Max Berger <max@...>  2009-07-24 05:30:24 PST ---
Georg,

thanks for the report. I had to modify your .fo file slightly to get both
pictures side-by-side, but that was not a problem.

Also, I noticed that evince showed both graphics to be the same, whereas
acroread does show them differently.

JPEG and PNG are treated very differently in XMLGraphics / FOP: JPEG is kept in
"RAW" format, and as such is written directly to the PDF, preserving all
properties. PNG is loaded through ImageIO and then painted as new bitmap onto
the PDF.

I have implemented extraction of the ICC profile from PNG when loaded through
ImageIO (rev. 797427). The PNG now has the correct color profile internally.
Unfortunately this information is still lost on the way into the PDF, which I
plan to look into soon.

What I would like from you: Could you "donate" the two files (PNG + JPEG) to
Apache XMLGraphics, so that I can include them as a test case? (A sentence
saying we're free to use them should suffice)

Max

--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@...
For additional commands, e-mail: general-help@...


DO NOT REPLY [Bug 47561] png color profiles seem to get lost during transfer to PDF

by Bugzilla from bugzilla@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

https://issues.apache.org/bugzilla/show_bug.cgi?id=47561


Jeremias Maerki <jeremias@...> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |general@....
                   |                            |org




--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@...
For additional commands, e-mail: general-help@...


DO NOT REPLY [Bug 47561] png color profiles seem to get lost during transfer to PDF

by Bugzilla from bugzilla@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

https://issues.apache.org/bugzilla/show_bug.cgi?id=47561





--- Comment #3 from Max Berger <max@...>  2009-07-27 02:00:53 PST ---
Created an attachment (id=24040)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=24040)
Patch for fop to use embedded profiles

I've added support for passing ICC Profiles in FOP to PDF, see the attached
patch. This fixes the sample files given.

As Jeremias noted that this is only a workaround and may result in
double-applying of color profiles, a more thorough investigation is needed to
fix this properly. Therefore the patch is as yet unapplied.

Possible direction: Maybe it is possible to extract a version of the ImageIO
codec? We could then at least support the "workaround" for some known broken
implementations (sun jdk 1.x - 1.x ?). Maybe it is also in the ImageIO spec not
to apply the icc profile (altough I could not find anything)?

Another option: JAI (>=1.1) seems to support ICC Profiles. Direction: Test with
and without the current patch to see if it breaks. Possibly suggest that
everyone using color profiles should install JAI.

I would prefer to keep ImageIO rather than a special codec, to keep fop/xgc
smaller (although XGC does contain a PNG implementation atm)

Max

Addtl. References:
http://java.sun.com/javase/6/docs/technotes/guides/imageio/spec/imageio_guideTOC.fm.html

http://forums.java.net/jive/thread.jspa?threadID=10573

http://download.java.net/media/jai-imageio/builds/release/1.1/RELEASE-jai_imageio.html

--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@...
For additional commands, e-mail: general-help@...


DO NOT REPLY [Bug 47561] png color profiles seem to get lost during transfer to PDF

by Bugzilla from bugzilla@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

https://issues.apache.org/bugzilla/show_bug.cgi?id=47561





--- Comment #4 from Max Berger <max@...>  2009-07-27 02:22:16 PST ---
Quick note:

Installing JAI-ImageIO 1.1 with the given patch applied does not break the
output, the icc profile is still applied correctly and only once.

Max

--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@...
For additional commands, e-mail: general-help@...


DO NOT REPLY [Bug 47561] png color profiles seem to get lost during transfer to PDF

by Bugzilla from bugzilla@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

https://issues.apache.org/bugzilla/show_bug.cgi?id=47561





--- Comment #5 from Max Berger <max@...>  2009-07-27 04:13:30 PST ---
http://svn.apache.org/viewvc?rev=798100&view=rev

Changed the original ICC Profile extraction to only occur with Providers known
NOT to apply the ICC profile when drawing the image onto a RenderedImage.

Tested Providers:
Sun JDK 1.5, 1.6, OpenJDK 1.6 (report the same name/vendor/version for ImageIO
plugins)
JAI-ImageIO 1.1

I know this is not the optimal solution, but it should work.

--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@...
For additional commands, e-mail: general-help@...


DO NOT REPLY [Bug 47561] png color profiles seem to get lost during transfer to PDF

by Bugzilla from bugzilla@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

https://issues.apache.org/bugzilla/show_bug.cgi?id=47561


Max Berger <max@...> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




--- Comment #6 from Max Berger <max@...>  2009-07-29 02:14:56 PST ---
Two more changes:
http://svn.apache.org/viewvc?rev=798806&view=rev (impl)
http://svn.apache.org/viewvc?rev=798815&view=rev (testcase)

- reverted the original changes. Although it worked, it did not modify the
internal color model, and therefore could have caused inconsistencies. Now the
color model is modified.

Impact:
  JPG - none, as RAW is normally used
  PNG withough color profile - minimal speed impact, the color profile is
checked for.
  PNG with color profile - high impact in display. The color model is now
re-created based on the ICC Profile. This works well with the supplied test
cases, but may not work in all cases.

JAI-Imageio 1.1 actually does apply the correct color model, so it is removed
from the list of broken implementations.

These changes make the FOP patch obsolete, as it currently extracts the profile
from the color model anyways.

Tested with Sun JDK 1,5+1.6, OpenJDK 1.6, Apple JDK 1.6.

From my POV the issue is resolved. Feel free to re-open if necessary.

Max

--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@...
For additional commands, e-mail: general-help@...