What's new
Photoshop Gurus Forum

Welcome to Photoshop Gurus forum. Register a free account today to become a member! It's completely free. Once signed in, you'll enjoy an ad-free experience and be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Photoshop altering jpg images at just opening them?


jist

Member
Messages
23
Likes
6
This is weird.
I noticed when opening a jpg image in Photoshop some diagonal lines looked aliased and distorted.

Original:
oRdwbjW.png

When opened in Photoshop:
t2ighuG.png

And to clarify, both with 400% zoom:
k5Jvzq4.png

iUy8ZKX.png

First I thought it might be a result of me having experimented with colour profiles. (without a good understanding of the matter)
Indeed the results changed a bit depending on a chosen profile, but I am still not able to get the image showing pixel perfect identical to the original.

Then I tried the following. I used paint.net to make a copy of the jpg image and save it as png.

Now here is what I do not understand at all:
When in Photoshop I open the png file it looks perfect, but when I open the jpg I get the distorted/aliased result.

So I now doubt if this does have anything to do with colour spaces or similar settings.

Could it be PS has problems with some sort of jpg images, or are there perhaps separate settings for jpg hidden somewhere?

T.I.A.!
(CC19.1.6)

In case somebody wants to replicate, here is the image I am using: Mod edit: Please upload all images directly to the forum. Thanks.
 

pauloalex_98

Power User
Messages
210
Likes
79
I have a clue of what it might be. Maybe it has to do with your Photoshop's settings. If you open a PNG and it looks perfect and the same but open a JPG maybe it has something to do with the settings when opening a JPG in Photoshop. Every Photoshop has settings for importing different types of files, not just exporting. When you try to open a PDF in Photoshop it always comes up with some sort of warning to alert you of the PDF's settings. So that's what it might be, your Photoshop settings for JPG importation.
 

jist

Member
Messages
23
Likes
6
Thnx pauloalex_98. I searched all over the place but I can't find any dedicated settings for opening or importing jpg images.
 

pauloalex_98

Power User
Messages
210
Likes
79
Thnx pauloalex_98. I searched all over the place but I can't find any dedicated settings for opening or importing jpg images.
You can try changing the settings in the Photoshop folder documents but tread lightly as it can mess up your Photoshop, anyhow, it is just a clue. Not entirely sure if it is really about the Photoshop settings
 

thebestcpu

Guru
Messages
2,988
Likes
2,747
Hi jist
To track down what you are seeing it will be necessary to understand some of the variable. e.g.
- Are these the original files or screen captures. The screen capture itself can introduce difficulties in tracking down some types of problems
- When you are not viewing in Photoshop, what software are you using to view the image e.g. a web browser. How web browsers send color numbers to your monitor can vary
- For the image to look the same, the non-photoshop software has to be color managed and the Color Settings in Photoshop need to be set up properly as well.

In addition to the above information, please provide the OS you are using, version of photoshop, and a screen shot of the Edit > Color Settings (expand to all options if you version of Photoshop has that)

I think this would be a good starting point for debug
 

jist

Member
Messages
23
Likes
6
Thanx thebestcpu,

- They are screencaptures, but I also included a link where you can download the original jpg file.
- When I view the original jpg image in e.g. paint.net or faststone image viewer it looks like the 'original'.
- PS version is CC19.1.6 (also hidden at the bottom of the startpost ;-)

I will read your reply better tomorrow and see if can get to understand the colour managing part better.

As I said before, what I find weird and what may give you some clue to what is happening/I am doing wrong: opening the png version looks good, opening the jpg version doesn't.
Opening the jpg in PS and immediately saving it to png without having done any adjustments saves the image with the introduced flaws.
 

thebestcpu

Guru
Messages
2,988
Likes
2,747
Hi Jlist
The forum and moderator wants files to be uploaded and not just linked. So if you could upload the JPEG file to a post that would be great.

For color management to work properly all the time, the image needs to have a color profile embedded and the software you use needs to be color managed (recognize the embedded profiles and know what to do with that file). If the color profile is absent, some software will make an assumption that the color profile is sRGB (sometimes right and sometimes wrong). If the software is not color manged at all, it will just pass the color numbers on "as is".

There are many color RGB scales in which to edit and also each piece of hardware (e.g. monitor/printer) have their own internal scale. If the scales are ignored, then you don't get consistency in color and tone.

Note that paint.net is not color managed as of yet (last I heard) and faststone can be at least partially color manged yet only if set up properly.

One thing you could try is use the File > Open in a color managed browser to view you jpeg image and also compare that to Photoshop and see if there is any difference.

You can check to see if you Browser is color managed by opening up this link read the instructions for the images on that page: http://www.color.org/version4html.xalter

Just some more suggestions.
John Wheeler



If the color manged browser and Photoshop match, they you are likely dealing
 

jist

Member
Messages
23
Likes
6
The forum and moderator wants files to be uploaded and not just linked.
I tried to edit my startpost to include the image, but that also doesn't seem allowed?
I'll add it here.
I won't be able to test the browser colour-managing stuff today, but I am still wondering about why the jpg version poses the problem and the png doesn't, and how colour profiles may play a role there. Could it have to do with the fact that I used MS Paint to open the jpg and save it as png? (I'll add both)

Later...

Maria Bethânia - Anos 80-90 - 640 x 578.jpg
 

jist

Member
Messages
23
Likes
6
Hm, looks like I am stepping into unknown and dangerous territory.
I see the jpg uses some YCbCr colour space, but the png uses rgb.
Perhaps that is the complicating factor here?
Damn, I wish I never spotted this ;-)

p.s.
The forum didn't display both pictures in my previous post, and it seems I am not allowed to edit that post now.
So this is me making another effort in adding both jpg and png versions...

Maria Bethânia - Anos 80-90 - 640 x 578 JPG.jpg

Maria Bethânia - Anos 80-90 - 640 x 578 PNG.png
 
Last edited:

thebestcpu

Guru
Messages
2,988
Likes
2,747
Hi Jist
If you make sure that the images you use have Color Space profiles embedded from the beginning and you do you critical viewing in Photoshop. I bet they will all look the same. The posted JPEG file is untagged. The PNG file is tagged as sRGB. By assigning sRGB to the untagged JPEG, they look identical.
Note that this is not the case necessarily in MS Paint. Color Management is determined by the Windows System settings and most likely they don't match the gold standard of Photoshop which does not depend on the system settings to get the color management right.

I did open up MS Paint in Windows 10 and did see the issues you described when the images were untagged. So I am pretty sure the root cause has been determined.
Hope this helps.
John Wheeler
 

jist

Member
Messages
23
Likes
6
Thanks again for your time and effort thebestcpu.

But I still have some questions. (please don't pull your hair out ;-)
I have checked some more jpg's with similar diagonals, and they all display correctly in PS. So it seems I just ran into a very odd duck with this specific jpg?

1. I still don't understand how it is that MS Paint, paint.net and faststone all display the jpg correctly, and only PS displays this ugly aliasing by (assumingly) applying some incorrect colourspace?
2. Are you saying I could tag the jpg with a colourspace (e.g. sRGB IEC61966-2.1) before opening it with PS? How would I do that? (changing/applying it within PS does have some effect but never gets the aliasing correct)

P.S.
Now that it seems this is just related to this very specific jpg, and chances of running into this problem more frequently are slim, I am not that concerned anymore.
So if you are getting a bit tired of this, feel free to leave it at this. Thanks for your help until now!

(Just f.y.i., when I first noticed this oddity, I had both my W10 and PS setup to use the icm profile that is available for my monitor.
Experimenting with all this now, I have set both to sRGB IEC61966-2.1 so I'm closer to 'default'?
Not sure it's important regarding all this, but I thought to mention it.)
 

thebestcpu

Guru
Messages
2,988
Likes
2,747
Hi Jist
So I will focus on must topic on crisp edges associated with non-color managed process.

If an image was created in a wider color gamut color space yet was left untagged, many programs interpret as being in sRGB (a narrower color gamut color space). The left side of the image is how the image was intended to be viewed, yet the right side of the image was how it would be viewed if the wide gamut image were interpreted as narrower gamut image. The lines look less scrisp because the reduced saturation reduces overall luminosity and the eyes perception of the sharpness.

Note that the actual color numbers were not changed between the two images, just how the color management system interpreted them differently.

I hope that gives you an example how lack of good color management can change colors and the perception of sharpness.

From what you indicated included changing settings in PS and in the OS, I suspect that your understanding of color management principles is a relatively new topic. If you are interested, I suggest you start a new post asking for pointers on where to learn more if that is any interest.
Hope this helps
John Wheeler

Maria-color-space-not-managed.jpg
 

jist

Member
Messages
23
Likes
6
I am not doing any photo critical stuff with Photoshop. So you are absolutely right that my understanding of (and interest in) colour spaces is lacking and was never of much interest to me.
Ignorant me was proud of himself for setting the icm profile of my monitor for both Windows and Photoshop. Go imagine.

I will certainly try to digest the things that you tried to explain to me at a later moment, and I much apreciate your efforts on that.

But for now I still don't understand why all other viewers that I use get this specific jpg right, and Photoshop doesn't.
And, I still haven't learned how I can get this specific jpg to display correctly in Photoshop.

It's probably me :-(
 

thebestcpu

Guru
Messages
2,988
Likes
2,747
Nope its not you. Color Management is often the bane of those who edit images.
When using non-color manged applications it is not easy to make things match in color and tone.
In somewhat simplified terms, every device and editing color space has its own color scale from monitors, printers, and the editing spaces you chose to edit in. It is similar to having each device and editing color space only know a specific different language and you are trying to make them talk to each other.
One way to go about this to minimize the need for understanding Color Management is have every device and editing color space talk to same language (i.e. are in the same color space).
Here would be the steps
1) All images created in sRGB color space
2) All images are tagged with the sRGB color space (no untagged images). Images that have no color space need to be assigned a color space Edit > Convert to Profile
3) If any images are in a non sRGB colorspace then convert them to sRGB (Edit > Convert to Profile and set the destination space to sRGB)
4) Use a monitor that is either very close to sRGB color space in gamut or has a setting for sRGB color space and you are using that mode
5) Photoshop Color settings need to be set to sRGB. under Edit > Color Settings the RGB working space set to sRGB
6) The OS settings for your monitor are set to sRGB color space
7) The OS default color space for all users is set to sRGB color space (this may help with non-color managed applications)

I think I have covered all the possibilities (yet not 100% sure) yet under these conditions everyone is talking the same language/color space and everything should look the same. As best as can be possible without better understanding of Color Management issues
Now of course, this is assuming that there are no bugs in the Color Management software (some do).

Do note that some file formats will change the color of your image somewhat. In particular, files that use indexed colors. e.g. file formats that don't use at least 8 bits of color depth for each of the RGB primary colors.

So why to the editors/viewers that are not color managed display things wrong (BTW its not Photoshop the is wrong, its the non-color manage applications). Those applications have no knowledge of color space / color scale, No translation to another color space if it is needed. They may or may not even tag the image with a color profile. Some do and some do not. They just edit the color numbers and shove them on their way to the next use be it another application or to another monitor. The specifics of what those applications do is a function of how the software designer built them. There are some applications that can be color managed yet only it you know how to turn on the option in Preferences or elsewhere in the application software.

So I would start with the list I have provided above and see how far you can get with that.

One last example. If I told you that it was 70 degrees outside how would you dress for that summer day outside? Well, depending on what country you live, you might assume a different temperature scale. 70 degrees is fine for short pants and short sleeve if I was referring to Fahrenheit. However, if I was referring to Celsius then you would not even want to go outside (note that 70 degrees Celsius is 158 degrees Fahrenheit. Its the same for colors. If you want a specific visual color of Yellow, the color number to use depends on what color space (color scale) you are using. Color numbers without a color scale is meaningless, of course unless everyone has universally agreed to a common scale.

Hope this helps in your understanding and feel free to ask more questions if you get stuck.
John Wheeler
 

thebestcpu

Guru
Messages
2,988
Likes
2,747
I thought I would add a couple pictures to demonstrate the impact of color spaces on color. I have shown the three common color spaces most often used for editing. This same type of image could be created for any RGB color space.

This first image shows a color spectrum from left to right. Any vertical stripe in the image has the exact same RGB Color Numbers.
The top section shows how such Color Numbers would appear in sRGB color space, the middle section Adobe RGB Color Space, and the bottom section ProPhoto RGB Color Space

Same-Color-Numbers-Different-Color-Spaces.jpg





This second image shows four colors on the left. The numbers to the right show the Color Numbers needed in each of the same Color Spaces to create that color.
The Color Numbers needed for the same color are quite different. Each Color Space is a different Color Scale.

Same-Color-Different-Color-Numers-in-Different-Color-Spaces.jpg


So if the user or software is not Color Managed (i.e. dumb about color spaces) you can see why it is possible for the colors to come out wrong. To get the same color (or even approximate), color management is needed to convert from your Editing Space, to your Monitor Space, and your Printer Space.

This demonstration is of course simplified yet hopefully sufficient to help a better understanding when Color Management is not used or just used incorrectly.

Hope this is found useful
John Wheeler
 

jist

Member
Messages
23
Likes
6
That's certainly very informative.
But still, I can't find the answer to my original question: Why does Photoshop display this specific jpg differently from other viewers?

I have set Windows 10 to use sRGB IEC61966-2.1
I have set Photoshop to use sRGB IEC61966-2.1
This jpg image has no colour-space tag. (I don't really know, but you established that)

So I am guessing that all non colour-managing viewers such as paint.net and faststone use sRGB IEC61966-2.1 to display this image because that is what is set in Windows?
(and they look perfectly o.k.)
And I would expect Photoshop to also display it using sRGB IEC61966-2.1, since the image has no colour space tag, and I have set PS to use sRGB IEC61966-2.1 as default.
But it looks differently in PS and certainly not o.k.

So, what am I still missing after all of your patient efforts to explain this to me ;-)

My layman's guess would be that there is maybe some corruption in this specific jpg file?
Or perhaps something in my setup is corrupt?
Or I am just thick and shouldn't be allowed to use advanced software such as PS anymore ;-)
 

thebestcpu

Guru
Messages
2,988
Likes
2,747
Hi Jlist
Its always possible that there is an issue that is beyond my ability to help. I am certainly not an expert on Microsoft Operating systems and how it specifically handles all conditions for Color Management.

One piece of information that might be helpful is the specific brand and model of monitor that you are using and any specific settings used with the monitor.

Note that even with the settings you have chosen, how non-color managed applications treat untagged images is not consistent. Some will assume that it is sRGB and do a conversion to you monitor profile stored on your system and other applications will bypass that step and just send the image data directly to the monitor with no conversion. There is not any consistency. Other applications will properly images in different color spaces and convert to sRGB and still not do a conversion to your monitor profile.

To simplify the steps for debug, there are two versions of the image below. They both have the same color number in their file. The first includes an sRGB profile and the second does not. To make sure they don't get mixed up, I descriptive text as well.

With my system, with my OS and PS settings, I have viewed them in Photoshop and they appear identical. I have also viewed them both in MS Paint and they look identical. I also saved both files to JPEG from MS Paint and viewed those images in PS and they both still look the same. This last step was to see if MS Paint made any changes. MS Paint kept the files the same as far as Color Space tagging and the only very subtle difference is that MS Paint save in a JPEG format that had higher compression.

Could you download these files and view them on system in PS and MS Paint and report back what you see. If you continue to see differences when I do not would indicate it is not an issue in the supplied files yet in some setting in your OS or applications.

At least the above should help determine if having color space tagged or not is part of the issue.

First Image has no color tag
mariabethaniaanos80-no-color-space-tag.jpg


Following image is with the sRGB color space tag
mariabethaniaanos80-sRGB-color-space-tag.jpg
 

jist

Member
Messages
23
Likes
6
Both images look identical in all my image viewers and in Photoshop.
I guess there must be some corruption in the original jpg, or something in my Photoshop has changed or has become corrupt that makes this happen for this particular image.
Unless some completely new thought comes up, or maybe when I reinstall PS sometime this year the mystery will get solved...

Thanks again, and bye for now.
 

thebestcpu

Guru
Messages
2,988
Likes
2,747
OK, will save this in the cold case files until and unless you want to reopen the issue.
If you do resolve the problem, it would be great to hear what you did to resolve the issue. Someone else may come across the same issue.
John Wheeler
 

Top