Skip to content
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

Fixes in the algorithm that detects what type of transparency an image has. #8425

Merged
merged 1 commit into from
Apr 6, 2024

Conversation

joa-quim
Copy link
Member

@joa-quim joa-quim commented Apr 5, 2024

The grdimage_transparencies() function detects if an image has transparency as a separate layer (I->alpha) or as a 4th layer as in an RGBA image, but this function was failing in more than one case. To start with it was always failing for pixel interleaved RGBA images, and for other it was also failing depending on image n_rows x n_cols and it was not scanning the entire alpha layer. When it failed it fell into the variable transparency case that is quite heavy in PostScript size.

I run the tests and apparently (and I say apparently because I can't make the remote and DVC files to be in sync) only the transp_mix test changed. But that test was already wrong because subplot (2,1) is exactly equal to (3,2) when the meant to be different. With this fix that sub-panel plot is still wrong as the transparency in figure is ignored. After many debugs I quit trying to find why it fails and also what was the original idea of that test. RGB images with a separate alpha layer also fail to set the transparency. Again, after long suffering trying to understand why, when all seem to go right, I gad to give up too. But this affects more the Julia side where that case is more common and I'm forced to save image in file and read it again (this forces a conversion to RGBA).

In summary, not all problems were solved but some important ones were.

@joa-quim joa-quim requested a review from a team April 5, 2024 23:24
@seisman
Copy link
Member

seisman commented Apr 6, 2024

because I can't make the remote and DVC files to be in sync)

can you explain more about this? are there any errors?

@joa-quim
Copy link
Member Author

joa-quim commented Apr 6, 2024

No errors, just > 50 failures mostly due to the use of different grids/images used on creating the original PS. When I do dvc pull it says is up to date and even added export GMT_DATA_SERVER="static" to the gmtest.in but nothing of that works.

Copy link
Member

@seisman seisman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blindly approve.

@joa-quim joa-quim merged commit 2251504 into master Apr 6, 2024
6 checks passed
@joa-quim joa-quim deleted the gdrimage-alpha-fixes branch April 6, 2024 14:38
@seisman
Copy link
Member

seisman commented Apr 8, 2024

I run the tests and apparently (and I say apparently because I can't make the remote and DVC files to be in sync) only the transp_mix test changed. But that test was already wrong because subplot (2,1) is exactly equal to (3,2) when the meant to be different. With this fix that sub-panel plot is still wrong as the transparency in figure is ignored.

Should we mark the transp_mix test as GMT_KNOWN_FAILURE?

@joa-quim
Copy link
Member Author

joa-quim commented Apr 8, 2024

Yes. One day I may get enough patience again to try to find why the constant transparency is failing.

@seisman
Copy link
Member

seisman commented Apr 8, 2024

Done in 0a10c48 and pushed directly to master.

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

Successfully merging this pull request may close these issues.

2 participants