[chimerax-users] Colors from snapshots

Tom Goddard goddard at sonic.net
Wed Jan 29 12:19:22 PST 2020


Hi Christophe,

  The reason the on-screen ChimeraX image appearance is different from the saved image is because the saved image "color profile".  On my iMac (macOS 10.15.3, 27" 5k retina display) if I screen capture (using command-shift-4) a scene similar to yours (same colors and transparency) and also save an image with "save test.png supersample 1" I find just as you do that the test.png image shown by Preview has less saturated colors then the screen capture.  In Preview I use menu Tools / Show Inspector and it says my screen capture is using "ColorSync profile: iMac" and shows test.png has "ColorSync profile: -".  If I use the macOS ColorSync Utility as described here

	https://support.apple.com/lt-lt/guide/colorsync-utility/csyncad0012c/mac <https://support.apple.com/lt-lt/guide/colorsync-utility/csyncad0012c/mac>

to assign the iMac ColorSync profile to test.png then my test.png has the same saturated colors as the screen capture.

  So I believe the RGB pixel values in the screen capture and the ChimeraX saved image are identical and that they appear different on screen in Preview because of different color profiles.  ChimeraX does not specify a color profile in the images it saves.  It is using the Python Image Library (actually the Pillow fork).  It is possible to set icc_profile for jpeg and png images in pillow, but it is not clear how to get the iMac profile or whatever profile is used on Windows and Linux -- probably need to query the operating system for what color profile is being used for the display.

  Using macOS ColorSync Utility I tried sRGB IEC61966-2.1 profile also and it looked identical to the None profile on my iMac.  There were a dozen other profile choices in the ColorSync Utility and they give quite different appearance, for example, Display P3 looks the same as the iMac profile while "Generic RGB Profile" looks even more faded than the saved ChimeraX image.

  I think ideally ChimeraX would save the color profile being used on your display.  But we don't have the resources to delve into how to implement that.  I've made a ChimeraX bug report to describe the problem.

	https://plato.cgl.ucsf.edu/trac/ChimeraX/ticket/2787

  Tom


> On Jan 29, 2020, at 12:22 AM, Christophe Leterrier <christophe.leterrier at gmail.com> wrote:
> 
> Hi,
> 
> After properly testing viewer vs supersample 3 vs supersample 1, (see screenshot attached from left to right), I can say that the color desaturation problem does still not come from the supersampling. non supersampled (supersample 1) is as desaturated as supersampled 3.
> 
> <viewer_ss3_ss1.png>
> 
> On Tue, 28 Jan 2020 at 19:22, Eric Pettersen <pett at cgl.ucsf.edu <mailto:pett at cgl.ucsf.edu>> wrote:
> Unfortunately, supersampling defaults to 3, so the “non-supersampling” command actually needs to be:  save myimage.png supersample 1
> 
> —Eric
> 
> 	Eric Pettersen
> 	UCSF Computer Graphics Lab
> 
> 
> 
>> On Jan 28, 2020, at 10:12 AM, Christophe Leterrier <christophe.leterrier at gmail.com <mailto:christophe.leterrier at gmail.com>> wrote:
>> 
>> Hi Tom,
>> 
>> thank you for your reply. I don't think it's due to supersampling. In the attached screenshot you see form left to right; viewer, no supersampling (save /Users/christo/Desktop/image1.png) and default supersampling (save /Users/christo/Desktop/image2.png supersample 3). The viewer is more contrasted and more saturated that both the non-supersampled and the supersampled images, that look identical. By the way this is on my MacBook Pro whereas the previous one was from iMac (both Retina though).
>> 
>> Christophe
>> 
>> On Tue, 28 Jan 2020 at 18:24, Tom Goddard <goddard at sonic.net <mailto:goddard at sonic.net>> wrote:
>> Hi Christophe,
>> 
>>   I guess you are saving the image with the Snapshot icon on the toolbar.  The equivalent command is shown in the Log panel
>> 
>>         save /Users/goddard/Desktop/image1.png supersample 3
>> 
>> It is probably the "supersample 3" option that is fading your colors.  That option says make the image 3 times bigger and then average over 3 x 3 pixel bins to obtain smoother edges.  If instead you use
>> 
>>         save myimage.png
>> 
>> I believe you will get identical colors to those you see on the screen.
>> 
>>   Maybe I should add some snapshot options to the preferences panel and I could let you choose whether you want supersampling.  On a Mac retina display the snapshot icon makes an image with half the resolution shown on the screen -- could also have an option to up the resolution.  Probably better to just fix it so it uses the screen resolution.
>> 
>>         Tom
>> 
>> 
>> 
>> > On Jan 28, 2020, at 8:12 AM, Christophe Leterrier <christophe.leterrier at gmail.com <mailto:christophe.leterrier at gmail.com>> wrote:
>> > 
>> > Hi,
>> > 
>> > I wonder why the colors in the snapshots (and movies) from ChimeraX are always washed-out compared to the colors I get live in the viewer. Attached is a screenshot with the viewer on the left, the corresponding snapshot on the right: one can see how the snapshot is desaturated compared to the viewer. From my limited tests it is the case when saving as both PNG and PPM, and I wonder if this could be corrected. I could saturate the screenshots afterward but it doesn't seem right to me to grossly mess with color levels post-hoc given how stunning the shaded rendering from ChimeraX are.
>> > 
>> > Thanks,
>> > 
>> > Christophe
>> > <viewer_vs_snapshot.png>_______________________________________________
>> > ChimeraX-users mailing list
>> > ChimeraX-users at cgl.ucsf.edu <mailto:ChimeraX-users at cgl.ucsf.edu>
>> > Manage subscription:
>> > http://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users <http://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users>
>> 
>> <viewer_nonsss_ss3.png>_______________________________________________
>> ChimeraX-users mailing list
>> ChimeraX-users at cgl.ucsf.edu <mailto:ChimeraX-users at cgl.ucsf.edu>
>> Manage subscription:
>> http://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users <http://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users>
> _______________________________________________
> ChimeraX-users mailing list
> ChimeraX-users at cgl.ucsf.edu
> Manage subscription:
> http://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimerax-users/attachments/20200129/39b3b3d3/attachment.html>


More information about the ChimeraX-users mailing list