Skip to content

dzsave: how to correct color or saturation #1670

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
hhentschel opened this issue Jun 2, 2020 · 13 comments
Closed

dzsave: how to correct color or saturation #1670

hhentschel opened this issue Jun 2, 2020 · 13 comments
Labels

Comments

@hhentschel
Copy link

hhentschel commented Jun 2, 2020

I noticed a different saturation (or color) output, after using
vips dzsave image.jpg foldername

The result has a lower saturation, not much, maybe 10% lower. One can see it on some colors.

Why is this happening and is there a way to change the saturation/ color output?

I did´nt find anything here and here.

@jcupitt
Copy link
Member

jcupitt commented Jun 2, 2020

Hello @hhentschel,

Sorry, you'd need to give some sample images and show the problem.

At a guess, perhaps your input image has a colour profile? dzsave will strip profiles from tiles as it writes, since most people will not want a copy of the same (potentially quite large) profile in every output tile.

@hhentschel
Copy link
Author

Hi jcupitt,

it is the same image we discussed in this question.

If you don´t have it anymore, i could send it again to you.
The image does have a color profile.
Is there a way to disable the removal of the color profile? Or will the image grow very big then?

@jcupitt
Copy link
Member

jcupitt commented Jun 3, 2020

I would convert the image to srgb before making the deepzoom pyramid. This will make your pyramid smaller and it should look the same to your users.

Try:

vips colourspace 234144.jpeg x.dz srgb

To make x.dzi and x_files.

@hhentschel
Copy link
Author

hhentschel commented Jun 4, 2020

Thanks, unfortunatly it is not working.
i get the same result.

i also tried converting first only the image

vips colorspace 234144.jpeg x.jpg srgb

and then your line of code, but did`nt work.

@jcupitt
Copy link
Member

jcupitt commented Jun 4, 2020

It looks like your profile only works with perceptual intent. Try:

vips icc_transform 234144.jpeg x.dz srgb --intent perceptual --embedded

@hhentschel
Copy link
Author

still no luck.
i also tried relative instead of perceptual, but no difference.

it looks like icc_transform makes it more redish, which is missing
when i try the colorspace.
And there is a difference in the redish tone, when viewing the whole image (
a lot of red) and as soon as i zoom in, there is less red.

@jcupitt
Copy link
Member

jcupitt commented Jun 4, 2020

Could you have made a mistake? It's working for me.

I ran:

vips icc_transform 234144.jpeg x.dz srgb --intent perceptual --embedded
vipsthumbnail 234144.jpeg 

Here's x_files/9/0_0.jpeg. It has no profile and has been converted to sRGB:

0_0

Here's the output of vipsthumbnail. It still has a profile and is in Adobe98 (I think):

tn_234144

They look the same to me.

@hhentschel
Copy link
Author

hhentschel commented Jun 4, 2020

Thats true, i get the same result. But a soon as you zoom in, the color changes.
Your first image is like this one, no zooming in:
image

But as soon as i zoom in the red tone disappears and it gets more green:
image

The difference is hard to see here in the comment, but in the viewer it is quite obvious.
Here is another example:
Original:
image

and after converting it:
image

@jcupitt
Copy link
Member

jcupitt commented Jun 4, 2020

Perhaps you have some tiles left over from an earlier run? Maybe your web browser has cached the old tiles? I would try saving to a new directory under a new name.

@hhentschel
Copy link
Author

Good Point. I will/can test that on monday.

Is there also a way to sharpen the image with vips?

@jcupitt
Copy link
Member

jcupitt commented Jun 6, 2020

Yes, many ways. Have a look at vips sharpen.

@jcupitt
Copy link
Member

jcupitt commented Jun 14, 2020

I think we're done, I'll close.

@jcupitt jcupitt closed this as completed Jun 14, 2020
@hhentschel
Copy link
Author

Hi,
sorry for that delay:
Just to recap and for future questions:
First issue: it's working now, probably the browser cache, but i also saved them in a new directory.

Second Question: vips sharpen works great. I had some issues finding the right coding formular, but with this, it works just fine for me:
vips sharpen x.jpeg newname.jpeg --m2 25

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants