Scirra / Construct-bugs

Public bug report submissions for Construct 3 and Construct Animate. Please read the guidelines then click the 'Issues' tab to get started.
https://www.construct.net
107 stars 83 forks source link

Colours change when copy/pasting in Animation Editor #5371

Closed brushfe closed 2 years ago

brushfe commented 2 years ago

Problem description

Copy and pasting part of an image changes the colour of the pasted image.

Attach a .c3p

https://drive.google.com/file/d/1-3t3HZVEhb5rmKGVI7qaAjJ0Bv8PWBXl/view?usp=sharing

Steps to reproduce

  1. Open the attached proejct.
  2. Open the sprite in the animation editor.
  3. Select a portion of the image.
  4. Press Copy (cmd/ctrl c)
  5. Press paste (cmd/ctrl v)
  6. Note the RGB colour values.

Observed result

The colours of the pasted image data are different than was what copied. (For example, the middle blue ring changes from 37/115/217 to 25/124/225.)

Expected result

The pasted image should be exactly what was copied.

More details

Affected browsers/platforms:

First affected release: r278.2 MacOS 11.6 Chrome 97.0.4692.71 (Official Build) (x86_64)

System details

View details PASTE HERE
brushfe commented 2 years ago
Screen Shot 2022-01-13 at 5 10 49 PM

Pasted on the left, original on the right.

DiegoScirra commented 2 years ago

So far not too much progress on this issue, only that it seems to happen consistently on OSX. Tried it in two different laptops with OSX 12 and they both showed the same problem, although with slightly different results.

No problems in Windows or iOS.

brushfe commented 2 years ago

Hey @DiegoScirra, good timing! I've found a couple of clues that might help. I think it may relate to the color profile. I've got C3 back to normal; here's what I did to get things working:

Now when i copy/paste sprites in the animation editor, the colour values stay the same. hope that helps!

DiegoScirra commented 2 years ago

This looks very similar to this Chromium issue

https://bugs.chromium.org/p/chromium/issues/detail?id=1264122&q=clipboard%20images&can=2

C3 is using the system clipboard if it can, and it looks like when you take image content out of the clipboard, it is being created using the sRGB color profile, regardless of how it was saved.

So it makes sense that if you force chrome to always use sRGB, that things will work.

DiegoScirra commented 2 years ago

Will close this issue now, as there doesn't seem like there is too much to do about it from our side. Will keep track of the chromium issue to see if anything changes once it is fixed.

brushfe commented 2 years ago

Ah ok! Thanks for the investigation. Hopefully they can make some traction on that bug, it seems like it's been around for a few months. Take care!

EDIT: @DiegoScirra is this colour shifting problem something that should be stickied somewhere? For anyone else working in pixel art, this can cause all kinds of problems with colour replacing, and (as in my case) require a lot of work to be redone in C3 to re-import images.