flxzt / rnote

Sketch and take handwritten notes.
https://rnote.flxzt.net
GNU General Public License v3.0
7.98k stars 271 forks source link

Background pattern renders differently in some Pdf viewers #874

Open JustCryen opened 10 months ago

JustCryen commented 10 months ago

Bug description
I use dark colors for my note background (not sure if similar issue occurs with light themed setups) but after exporting the document to the PDF, the background pattern gets much brighter depending on the zoom level.
The further away / smaller the page on the preview, the more intense it gets making the page harder to read.

I've compared the results with the Xournal++ PDF export and while it can be said that it handles the penstrokes (also while zooming) a bit funny (exaggerated on the page preview) I much rather have the PDF work like the Xournal++ does it than how currently it does on rnote.

Left: Xournal++ PDF export Right: rnote PDF export

Zoom level: fit width
Example-1-fit-width

Zoom level: un-zoomed 3 times from previous option
Example-2-unzoomed-3-times

Zoom level: zoomed in to the max
Example-3-zoomed-in-max

For reference, this is how it currently looks while editing the document. It's fine here and the zoom doesn't influence the background pattern brightness in any way. Page size is basically A3 but it also shouldn't influence the pattern brightness.
Example-4-rnote-draft

Reproduction
Steps to reproduce the behavior:

  1. Change the theme to "dark" (I have a custom background color and pattern color)
  2. Go to "hamburger" menu -> Export Document
  3. Select "With Pattern"
  4. Check the exported PDF

Expected behavior
The background color doesn't get overwhelmingly bright when changing PDF zoom level, just like on Xournal++ I don't know why it gets any lighter than what is set in the document settings.

Console Output
(Since the issue is cosmetic and after export, I don't think that console output matters at all.)

Desktop:

JustCryen commented 10 months ago

I realized that I started using A3 format just because it had the best 100% zoom level for my 13" screen and the best grid scale by default but I've now changed to a more appropriate A5, tweaked the DPI and I can confirm that nothing has changed, the PDF preview works exactly the same. Weirdly enough, the page dimensions of the PDF read exactly the same.

Doublonmousse commented 10 months ago

Are you using evince as the pdf reader ? I have some grid-related bugs as well when reading the pdf in edge (with the grid appearing non continuous/jumping depending on the zoom level or with a variable offset depending on the zoom level so that elements that were aligned on the grid in rnote may not be seen as aligned on the grid when viewing the pdf depending on the zoom level).

JustCryen commented 10 months ago

@Doublonmousse
That's correct.
Well, good thing the lines are at least not jumping in Evince xP

flxzt commented 10 months ago

Sounds like a rendering issue in some Pdf viewers to me, and not like something that can be fixed by Rnote. For example in firefox the background pattern renders differently than in evince:

pdf-firefox-evince

JustCryen commented 10 months ago

If that's not something that can be fixed by Rnote, why is that Xournal++ does it right?
I'm sorry for pulling the direct comparison card but it's clear that Rnote's exports are having issues with background pattern brightness when scaling the PDF while Xournal++ exports do it flawlessly.
In Xournal++ the lines in exports get thicker (I think) but stay the same color which makes them not overpower the pen color.
It does indeed look like in Firefox the issue is less pronounced but it still is there. Since Xournal++ does it, what makes it impossible to do for Rnote?

It actually might be as simple as the way the grid is being viewed in Rnote itself, since the grid lines are thinner then in Xournal++, I need to make the grid a bit brighter to compensate and to still be able to see it clearly.

Actually… let's test that.

Rnote on the left Xournal++ on the right

This is how I was using it previously,
Issue-previous-colors-normal-editors

The same situation but zoomed in.
Issue-previous-colors-zoomed-editors

This is after matching the grid color to the Xournal++, it's way harder to notice the lines since the grid line is likely 1 pixel thick, unlike in Xournal++ when it looks like it's at least 3 if not 4.
Issue-same-color-editors

The same situation but zoomed in.
Issue-same-color-zoomed-editors

Now this is how it looks in exports.
Issue-same-color-unzoomed-export

And the same but zoomed in.
Issue-same-color-zoomed-export

So clearly it helped with how it looks when unzoomed, but when zoomed in, the grid is still 1 pixel wide. The grid is still too dark in Rnote preview to use it like this on a daily basis.
So a solution might be either increasing the grid thickness or making it adjustable in settings, that's my guess for now.