Skip to content

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

Merged
joa-quim merged 1 commit into
masterfrom
gdrimage-alpha-fixes
Apr 6, 2024
Merged

joa-quim merged 1 commit into
masterfrom
gdrimage-alpha-fixes

Conversation

@joa-quim

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

Copy link
Copy Markdown
Member

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

seisman commented Apr 6, 2024

Copy link
Copy Markdown
Member

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

joa-quim commented Apr 6, 2024

Copy link
Copy Markdown
Member Author

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.

@seisman seisman left a comment

Copy link
Copy Markdown
Member

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
@joa-quim
joa-quim deleted the gdrimage-alpha-fixes branch April 6, 2024 14:38
@seisman

seisman commented Apr 8, 2024

Copy link
Copy Markdown
Member

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

joa-quim commented Apr 8, 2024

Copy link
Copy Markdown
Member Author

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

@seisman

seisman commented Apr 8, 2024

Copy link
Copy Markdown
Member

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