# Png save and screen capture producing different results

**URL:** <https://discourse.processing.org/t/png-save-and-screen-capture-producing-different-results/26296>\
**Category:** Coding Questions\
**Created:** [December 16, 2020, 9:04am UTC](https://discourse.processing.org/t/png-save-and-screen-capture-producing-different-results/26296 "2020-12-16T09:04:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![saltandonion](https://avatars.discourse-cdn.com/v4/letter/s/4bbf92/32.png) [@saltandonion](https://discourse.processing.org/u/saltandonion)\
**Post date:** [December 16, 2020, 9:04am UTC](https://discourse.processing.org/t/png-save-and-screen-capture-producing-different-results/26296/1 "2020-12-16T09:04:29Z")

</div>

has anyone else noticed saving a frame to png alters the colors from processing?

i setup a code that just randomly creates 100 squares of random colors. i save the frame as a png and take a screen shot. the colors are subtly different. but the difference become greater the redder the color.

same results do not happen when save screen to tiff.

is this a png native issue?

size(100, 100);  
for (int i=0; i\<10; i++) {  
for (int j=0; j\<10; j++) {  
noStroke();  
fill(random(255), random(255), random(255));  
rect(i_10, j_10, 10, 10);  
}  
}  
saveFrame(“out.png”);

it’s the darnedest thing

---

<div class="post-metadata">

**Author:** ![SomeOne](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/someone/32/8639_2.png) [@SomeOne](https://discourse.processing.org/u/SomeOne)\
**Post date:** [December 17, 2020, 12:09pm UTC](https://discourse.processing.org/t/png-save-and-screen-capture-producing-different-results/26296/2 "2020-12-17T12:09:40Z")

</div>

I think it’s color management issue. RGB color (or any colors) are always associated with a color profile. Color profile is device dependent and it tells how to present a color in the device. Print screen happens on os level and os links used display (color) profile to the file. I assume that processing does not link any profile to png and therefore os uses standard profile with it, which may be correct or not.

---

<div class="post-metadata">

**Author:** ![saltandonion](https://avatars.discourse-cdn.com/v4/letter/s/4bbf92/32.png) [@saltandonion](https://discourse.processing.org/u/saltandonion)\
**Post date:** [December 17, 2020, 5:24pm UTC](https://discourse.processing.org/t/png-save-and-screen-capture-producing-different-results/26296/3 "2020-12-17T17:24:33Z")

</div>

if this is so, why would a tiff saveFrame be accurate but a png output have different results?

---

<div class="post-metadata">

**Author:** ![SomeOne](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/someone/32/8639_2.png) [@SomeOne](https://discourse.processing.org/u/SomeOne)\
**Post date:** [December 18, 2020, 6:28pm UTC](https://discourse.processing.org/t/png-save-and-screen-capture-producing-different-results/26296/4 "2020-12-18T18:28:10Z")

</div>

I don’t know. Not enough information to tell. I just know from long experience with image editing and photographs that such differences with colors most often are caused by problems or differences with color profiles
