11

I was trying to open an iPhone screenshot in Illustrator, but for some reason the colors are distorted. If I open the same file in any other application (Photoshop, GIMP, Preview, etc.) the colors are rendered fine. The curious thing is that this only occurs with certain screenshots, as I tested a screenshot of the home screen as well, which Illustrator opened without distorting the colors.

Though, with GIMP, a dialog does pop up stating:

The image 'IMG_1199.PNG' has and embedded color profile:

Display P3

Convert the image to the RGB working space (sRGB built-in)?

With the option to either keep or convert the color profile; which makes me think Illustrator may not recognize the aforementioned color profile.

Here is the original image directly from the phone [left] and the image opened (then saved) from Illustrator [right]:

iPhone Keypad Screenshot iPhone Keypad Screenshot Distorted


Update

Converting the color profile in GIMP, saving, then opening the file again in Illustrator does fix the issue. This seems to confirm my suspicion that the Display P3 color profile is the issue, which changes my question somewhat: how can I open the image in Illustrator without first converting the image beforehand?

This seems like it may be a bug in Illustrator, so I have submitted a bug report to Adobe. I will update if the report is conclusive, or if Adobe provides a solution.

  • 1
    Psychedelic! I know people who eat pills in order to see this. Hey Bryan, welcome to GDSE and thanks for your question. If you have any questions about this SE, have a look at the help center or feel free to join us in Graphic Design Chat! Keep contributing and enjoy your time here. – Vincent Oct 19 '16 at 15:58
  • I've had loads of problems with iPhone screenshots but I've never had anything like that. Impressive. – Cai Oct 19 '16 at 17:03
  • Does a P3 color profile imply 10bpp color (aka 30bit)? Is this a bug, or is AI just not able to handle 10bpp (ARGB 02 10 10 10)? Enquiring Minds Want to Know. (edit: to be clear, I really do want to know, as I have no clue) – Yorik Oct 19 '16 at 18:55
  • Strange: Both, GraphicsMagick's identify and Linux' file, identify your posted screenshot on the left as a jpg despite its .png suffix. Is this the original/unmodified screenshot? Did you rename the suffix to .png? Maybe that's the problem. Try to change the suffix to jpg and open it again. – Socowi Oct 19 '16 at 20:05
  • @Socowi Huh, that is strange, I tested it myself using the file command on macOS. It comes up as JPEG image data as well, even though the info window still displays it as a PNG file. It must be something Imgur does to scale the photos. If you download the image from the full size link the file command should recognize it correctly as a PNG file. – Bryan Oct 19 '16 at 20:18
9

What probably happens: The screenshot is a 16-bit png, but illustrator reads it as an 8-bit png, using only the 8 lower (!) bits.

Explanation

For the following explanation we assume that the screenshot is an 16-bit grayscale image, that is every pixel is a number between

black = 0 = 0x0000 = 0b 0000 0000 0000 0000

and

(16-bit) white = 2^16-1 = 65535 = 0xFFFF = 0b 1111 1111 1111 1111.

(0x denotes hexadecimal numbers and 0b denotes binary numbers)

Illustrator seems to load only 8 of these 16 bits, unfortunately the wrong ones, that is the least significant ones. Choosing the least significant bits is the only problem.

0b #### #### #### ####
   \_______/ \_______/
   discarded   loaded

After the import, illustrator will scale the interpretation (which number is white, which is black) according to the new maximum number:

(8-bit) white = 2^8-1 = 255 = 0xFF = 0xb 1111 1111.

Assume one of our pixels had the value 0b 1111 1111 0000 00001 = 0xFF01 = 65281, that is nearly white. After the import, the value will be 0b 0000 0001 = 0x01 = 1, that is nearly black.

It's like "rounding" 999.1 to 1 – completely wrong!

Simulation

How can we be sure that the described problem is our problem? We simulate the bug!

The following python program loads the 16-bit screenshot as described above.
(Please don't judge me, it's my very first python program.)

#! /usr/bin/python
import numpy as np
import cv2

# load picture
img = cv2.imread('screen.png', 3)

# assert (by hand) that picture is loaded as 16 bit image
print img.dtype

# simulate the bug
img[:,:] &= 0x00FF # use only 8 least significant bits
img[:,:] <<= 8     # rescale

# save the picture
cv2.imwrite('bug.png',img)

Simulated bug
the result bug.png
Click here for original size, and here to compare with OP's version.

As we can see, our simulation yields exactly the same result.

Workaround

I only can think of one workaround (since I do not use illustrator):

Convert your screenshots to 8-bit pngs

GraphicsMagick and/or ImageMagick are console tools which are convinient for this job. The following command converts to 8-bit pngs:

convert original.png -depth 8 converted.png
  • Wow, thank you for the in-depth explanation. Adobe has not responded to my bug report yet, but with any luck hopefully they will add proper 16-bit color support to Illustrator. Or at the very least round them to 8-bit color correctly. – Bryan Oct 20 '16 at 13:20
1

Now that is some funky issue.

GIMP already give us some clue, confirming the suspicion that it is something with the color profile of the screenshot. Converting it your everyday sRGB and 8bit per channel may avoid Illustrator to mess things up on trying to pull it as CMYK.

1

This is WAY late, but a simple workaround (for Mac users) is to open the PNG in Preview, then Export it as a PNG switching the default 16-bit option to the 8-bit option. It doesn't require any additional software, and only takes a few seconds.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.