Skip to content

Conversation

@joa-quim
Copy link
Member

@joa-quim joa-quim commented Nov 7, 2024

The fix in the #8255 was actually very incomplete and left the working array still pointing to a zero filled array and hence this type of transparency was totally broken. This PR fixes that. But this PR also addressees other situations.

  • For the variable transparency case, and given that it implies cresting a much bigger ps that considerably slows down the image rasterization, a new modifier +t is added to -Q to select true transparency. Otherwise, and by default, a blended transparency, that is an opaque combination of colors and alpha's, is computed.
  • The single transparency value case was not working at all. This PR now does also the blended composition by default.
  • The -Q docs are modified but I don't think they are telling the full truth. Debugging the code I don't see where a 2-values transparency layer is creating a true transparent figure. I always see the code path falling into the grdimage_img_set_transparency function that either copies a color or blends it. I don't know enough postscript to follow this matter any further.

If someone wants to play with a variable transparency file, here is one.
stefan_rgba

EDIT: The SC bellow sows a cut of the original of the transp_mix test. The top left image (that in fact is the second row, first col of the full image) shows the same grid pattern as the lower left. This grid pattern in PS is what we see when using the true variable transparency that works by drawing a rectangle for each pixel (that is why those PS are huge). So, at a given point the single value transparency (obtained for example with grdmix -A) must have been working, but as I said above, I have no idea how. I think we should replace that orig PS by the one produced now by the transp_mix.sh script and remove the GMT_KNOWN_FAILURE. @seisman Coul you do it after this RR is merged? I am not able to update original PS's.

image

@joa-quim joa-quim requested a review from a team November 7, 2024 12:07
@joa-quim
Copy link
Member Author

joa-quim commented Nov 7, 2024

Looks something is holding running the CI tests. I run them locally and no new failures were found.

@Esteban82
Copy link
Member

I test the transp_mix.sh and I am getting some weird figures with linux.

If I use gmt begin transp_mix ps,png, I got this png (with this branch):
transp_mix_ps-png_branch

And I got this one on master:
transp_mix_ps-png_master

But when I only ask for a png (gmt begin transp_mix png) I got this figure (in master and in this branch):

transp_mix_png_master

@joa-quim
Copy link
Member Author

joa-quim commented Nov 7, 2024

Strange. This is what I get with this branch after removing the GMT_KNOWN_FAILURE from transp_mix.sh and running ctest -R transp_mix

transp_mix.png

transp_mix

transp_mix_diff.png

transp_mix_diff

@Esteban82
Copy link
Member

Ok, I will try again at my home.

@Esteban82
Copy link
Member

Ok, I will try again at my home.

I got this image. I don't know what is happening.

transp_mix

@joa-quim joa-quim merged commit 0a7ecac into master Nov 9, 2024
@joa-quim joa-quim deleted the more-transp-fixes branch November 9, 2024 15:28
@seisman
Copy link
Member

seisman commented Nov 11, 2024

Sorry I don't get it. There are only documentation changes in this PR, no?

joa-quim added a commit that referenced this pull request Nov 11, 2024
(Fix the variable transparency case that was broken by the #8255 commit.)
@joa-quim
Copy link
Member Author

Ghrrr, I made the commit from the rst directory and the C files were left in my computer only. Now in #8613

joa-quim added a commit that referenced this pull request Nov 13, 2024
* Commit the files that should have gone into #8612

(Fix the variable transparency case that was broken by the #8255 commit.)

* Add the two modified tests.

* Update baseline images

---------

Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
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.

4 participants