Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

No error when comparing images with transparent areas #14

Open
khavishbhundoo opened this issue Jan 18, 2017 · 8 comments
Open

No error when comparing images with transparent areas #14

khavishbhundoo opened this issue Jan 18, 2017 · 8 comments

Comments

@khavishbhundoo
Copy link
Contributor

When you compare images of different formats , the output is a value.I think an error should be displayed in such a situation.

@robryk
Copy link
Contributor

robryk commented Jan 19, 2017

Can you explain what do you mean by a format?

@khavishbhundoo
Copy link
Contributor Author

@robryk i mean different image types.For example if you compare a JPG with a PNG there is no error.

@robryk
Copy link
Contributor

robryk commented Jan 19, 2017

Why do believe there should be? Image format is just a way of storing an image, similarly a filesystem is just a way of storing files. Would you expect an error if I wanted to compare two JPEGs that reside on different filesystems?

@khavishbhundoo
Copy link
Contributor Author

Would you expect an error if I wanted to compare two JPEGs that reside on different filesystems?

Certainly not

My logic is that PNG supports transparency unlike JPG.It seems like an unfair comparison to me.For e.g take a PNG image that isn't transparent , convert it to jpg.Then when you compare the original PNG with the JPG.

I certainly didn't look at it with the file systems perspective thought

@robryk
Copy link
Contributor

robryk commented Jan 19, 2017

Ah, I see. So as far as I understand, the issue is that if the PNG uses transparency, the results might be different than expected, whatever we choose them to be. Please correct me if I misunderstood.

Still, there's lots of cases when one has a PNG without transparency and wishes to compare it with a JPEG. I'd very much like to preserve this possibility.

Right now, whenever we (both in Butteraugli and Guetzli) read a PNG with alpha channel, we overlay it on black. What would your alternate proposal be? Report an error if there's an alpha channel and it's not all-opaque?

@khavishbhundoo
Copy link
Contributor Author

Still, there's lots of cases when one has a PNG without transparency and wishes to compare it with a JPEG.

Can you enlighten me on this by giving some example use case.

Right now, whenever we (both in Butteraugli and Guetzli) read a PNG with alpha channel, we overlay it on black. What would your alternate proposal be? Report an error if there's an alpha channel and it's not all-opaque?

Exactly ....report an error if alpha channel exist and image isn't opaque.A flag say --ignore-transparency-warning for those who wants to overlay it on black

@robryk
Copy link
Contributor

robryk commented Jan 19, 2017

Can you enlighten me on this by giving some example use case.

I have a PNG (it's a PNG because I want a lossless format). I encode it as a JPEG using some tool. I then want to see how well does the tool do on this image (and maybe, I intend to adjust the quality level to achieve some Butteraugli score at lowest possible cost).

Exactly ....report an error if alpha channel exist and image isn't opaque.

One nit: an image might have an all-opaque alpha channel. We should treat it the same as a similar image with no alpha channel.

I am fine with such a change (even without the flag; adding flag handling here is likely going to be very annoying). I won't have time to do that in the near future, but would welcome PRs.

@robryk robryk changed the title Error missing while comparing images of different formats No error when comparing images with transparent areas Jan 19, 2017
@khavishbhundoo
Copy link
Contributor Author

I have a PNG (it's a PNG because I want a lossless format). I encode it as a JPEG using some tool. I then want to see how well does the tool do on this image (and maybe, I intend to adjust the quality level to achieve some Butteraugli score at lowest possible cost).

Its an interesting use case and it give me an idea.We could have a function say QualityForButteraugliScore in butteraugli that get called when user uses a flag say --target-score=X where X is a butteraugli score and output the quality setting.Then the user just need to use that quality in a tool of their choice.

One nit: an image might have an all-opaque alpha channel. We should treat it the same as a similar image with no alpha channel.

Yup

I am fine with such a change (even without the flag; adding flag handling here is likely going to be very annoying). I won't have time to do that in the near future, but would welcome PRs.

Very annoying in terms of time usage or because the tool is quite popular and would annoy people

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

No branches or pull requests

2 participants