Inconsistent tone curve with embedded grayscale PNGs when exporting to PDF and importing to Photoshop, or converting on zamzar.com
Summary:
Not sure if this is a bug or my ignorance (or a bug in another piece of software):
When exporting an SVG to PDF with embedded PNGs, PNGs that are Grayscale will not render properly when the PDF is imported into Adobe Photoshop, but this issue will not occur when the PDF is opened in Firefox, GIMP, Okular, Adobe Illustrator, etc. It appears as if a strong tone curve is applied, which makes the images too bright.
PDFs that are exported from Scribus or Adobe Illustrator do not exhibit this issue.
Steps to reproduce:
- open the attached SVG file
- export to PDF
- import the PDF into GIMP, or open in Firefox, or Okular, etc.
- also import the PDF in Adobe Photoshop or use zamzar.com to convert it to PNG
- open the attached SVG in Scribus (or Adobe Illustrator)
- export to PDF (with export color mode as "screen/web") and repeat viewing/importing steps
What happened?
- observe that all four squares are identical to each other in Firefox, Okular, GIMP, etc. Only when the PDF is opened in Photoshop are the bottom three squares a much brighter color
- observe that the PDF exported from Scribus or Adobe Illustator works in all places
- observe that the bottom three squares are embedded PNGs of type "Grayscale", where the top square is type "TrueColor" (i.e. RGB)
- the tonal differences are pretty dramatic (stronger than might be perceived in only this example)
What should have happened?
I'm not sure -- it appears that on PDF export Inkscape is somehow manipulating the tone curve only for grayscale bitmap images. I don't know if it's doing it "wrong", but it's not in accordance with every other piece of software I tested. And the main problem is that after you do your layout and check all your colors and such, the print shop you send your file to will print the wrong tones.
Further compounding this issue is the fact that GIMP exports all-gray RGB images as grayscale PNGs, even if you specify "8bpc RGB" on PNG export.
- For the demo file, all four images are created with identical gray pixels.
- the first square is all gray except for a single red pixel. It exports from GIMP as an RGB PNG.
- the second square is an RGB-mode image with all gray pixels, and upon export "8bpc RGB" is chosen in GIMP. AFAICT in this case GIMP exports a Grayscale PNG with metadata signaling that it should be imported as an RGB image, which works. But being encoded as a Grayscale PNG is nonetheless sufficient to trigger the problem.
- the third square is a grayscale-mode image exported as "8bpc RGB"
- the fourth square is a grayscale-mode image exported as "8bpc GRAY"
As you can see, only the first image renders as expected in Photoshop.
Sample attachments:
- attached is the demo SVG with four bitmap images
- attached is also a PNG showing the results when imported into Photoshop (*I am using an ancient CS2 version of Photoshop, but my local print shop with modern versions sees the same thing)
Version Info:
Inkscape 1.0.1 (1.0.1+r73)
Pango version: 1.44.7
Kubuntu 20.04.1 LTS
Linux hostname 5.4.0-47-generic #51-Ubuntu SMP Fri Sep 4 19:50:52 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux