Screentone quality of Krita 4.4.x

I think the screentone quality in Krita, compared to photoshop and CSP, might be a bit in the rear.
Especially when you toggle maximum hardness. With Krita, there’s a very noticeable inconsistency which favors the apparition of Moiré effect as you zoom out.
And it’s caused by the space between the dots.
For comparison, I used CSP(CSP has the same screentone filtering than photoshop, with a few more features added, but they render the same, in a sharp and most consistent manner).

Details :
Filled an area with fully opaque 25% gray(rgb value : 191,191,191)
Applied the screentone after I made a calculation of the dot size which is about 75 lines of dots per inch( pretty much equals almost 75 dots per inch ) on a 500 ppi canvas in both apps.
Since it’s 500 ppi, any dot would have almost a size of 6.66 pixels.
First I used the “screentone” option in the halftone filter with max hardness,
50% brightness and contrast, and with linear interpolation.

Result in Krita :

Up close(Krita) :

Result in CSP :

up close(CSP) :

I tried the “pattern” option for the screentone generator.
And used an already made screentone texture. Results were still quite different. A little more consistent, but not that much, there was still a potential for the apparition of moiré with low scale, starting from a certain level(by counting the number of pixels for each dots and comparing both CSP and Krita’s results, consistency was much better in CSP).
And with Krita, I don’t know why, but I can’t find an option to set the number of lines per inch just like in other softwares with this option.
While this least seems just more convenient as it automatically converts value to tone weight,
It only possesses a scale, which means, you can only judge the quality with your eyes.
I must say though, that I’m impressed by the variety of textures one can obtain by using different patterns.

The experiment isn’t over. One more thing I’d do is try printing these screentones and see if the moirés still appear.
One other option, would be to use a vector program, arrange 6.66 pixel circles in them, in a fashion similar to screentoning, and then generate a jpeg or png image from there, just to see how the “nearest neighbor” algorithm would treat the rasterization of the image.

Hi

If I remember screentone generator has been rewritten by @Deif_Lou who might be the right one to give you answers I think.

Grum999

The patterns in the screentone generator are procedurally generated, so those aliasing/moire artifacts are unavoidable, specially at those sizes and with fractional position/size and rotation.
I don’t think that aliasing is a problem when printing at 300ppi.
If you want to fine tune the pattern you can use a custom image with the pattern generator.
If you still want to use the screentone generator and avoid the “artifacts” as much as possible you can try to align the transformed pattern to the pixel grid. For example, for 45º angle use a size multiple of square root of 2 (1.4142…). The result is not perfect but is kind of regular. For other angles or fractional position it becomes trickier.

This is sad news…
That means I’d have to use either Photoshop or CSP if I need the best screentones a software can make.
:cry:

Behold the result in Photoshop(75 dots lines per inch, 600 ppi, 25% gray(191,191,191 rgb value).
Just look how consistent the dots are.
That’s how good halftone should be rendered…

Up close(look at the consistency, it’s just insanely well handled…)

Now I tried with 500 ppi, 75 lines per inch . And like I said earlier, it renders exactly the same as in CSP :

Up close(PS) :

Angle was 45° for all the results in CSP and Photoshop, so far.

I promise that the consistency makes a big big difference when working with it.
Now I understand my bottlenecks with the halftone filters in Krita.
I needed more than a month to come up to this final conclusion.
Please, if I may request something, implement a halftone filters which gives the same result than Photoshop/CSP. That of course means, a newer version would arrive, offering the option to render a number of dot lines per inch.

Use case example :
Resolution : 500 ppi
Frequency : 60 (in lines per inch)
Shape : round/diamond/… etc.

The resulting rasterization should not leave any gray despite the automatic value conversion to dot size…

I can only hope an update will come in the future.

1 Like

The pattern is different from what you see in other software, but it is consistent in Krita right?

I get consistent pattern in Krita. In your example of screenshot of Krita, if you check the resulting screen tone, it doesn’t give the similar value of grey (visually) (191, 191, 191) to the patch. I mean when you zoom out the resulting filter should look like the same grey patch of colours. This is important for shading comics to be printed this way etc. The greyscale value should be maintained as the artist visualized and painted it.

Here are my results in Krita

Up close

Seems consistent to me.

If I check the value the results seems to have close enough value to that of the original colour patch (191,191,191).

To get this result I bumped up the contrast to 100% in post-processing tab. Reducing it to 85-90 would give exact value I think.

Now let us check what we get with your method in Krita, that is 50% contrast. If I reduce the contrast to 50%, the pattern that I get is exactly similar to what you have shown for Krita. The pattern is again consistent but the resulting value of the patch is not same as the colour. You can see that in the video below. See how the resulting screen tone gives a lighter value to the patch than what the original colour gives you.

The issue here is the workflow to add screen tone is different in Krita and to achieve what you get in CSP or photoshop you have to tweak settings. Krita doesn’t give you lines per inch or dots per inch setting, instead there is a size setting in the transformation tab.

Again this is the reason why we say Krita is not a copy of photoshop or CSP It has its own way of doing things.

Your request can be to allow adding screen tone with dpi or ppi and colour as input. Krita seems to give you screen tone with reduced value. So we can as @Deif_Lou if the resulting patch of screen tone can be made to have similar value (visually) of the colour. The defaults in other software seems to give a patch with relatively similar value in comparison to the patch of colour that is provided to the filter. That way we would not have to tweak the contrast setting to get a similar value for our screen tones.
Apart from the default, I surely like having the ability to tweak the value of the tone on the fly, something which is not there in CSP or Photoshop, I presume. In CSP you have to open another adjustment to adjust tones.

@novames00 : The issues of moire patterns created due to aliasing and that inconsistency of the shapes due to differing, for example, a fractional part of a pixel in position is all over computer graphics. The most common solution to that (that I know) is some kind of antialiasing.
Now, if PS or CSP show more similar dot shapes through the pattern, it has to be at the expense of something. If I recall correctly, PS does (did when I tried) some kind of adjustements to the pattern so that the dots align better and give a consistent look. For example it changes the angle you choose slightly, and I’m sure it also adjusts the “lines per inch” parameter. In the one hand it gives the “consistency” you want, but in the other hand it ignores your exact choice. Try applying an angle of 46 degrees in PS, it most probably will adjust to 45. I think the same will happen with the “lines per inch” parameter.
In Krita, the halftone filter tries to respect the parameters you choose and rely in antialiasing for the good results. It’s funny that you consider the PS/CSP way better looking, I mean, for me better looking means antialiased edges.

When I did the screentone generator I thought about those two things.
The “lines per inch” feature is easy to implement, just a linear mapping to the grid size (the size parameter).
The other part, having the result resemble the grayscale tone of the image, is trickier, but doable. Each algorithm would have to be fine tuned in a specific way. Right now they just use the raw functions (sin, linear or whatever). Even more, to be totally correct it should have to take into account the color mode and the profile. Thats a lot of work.

This is not a requirement for me. Might be for people coming from other software where this is the GUI norm. So I do not have a request for this.

On the other hand it would be better to have consistency in terms of the value of the input image and the output tone. This again is not required right now. Maybe an improvement of default in future.

@raghukamath, @Deif_Lou
The bad thing with the contrast setting available, especially when it’s not close to 50%, is that it translates the values very badly in my opinion. The screentone would look more consistent, but still not rendered the same as in Photoshop/CSP. Either you keep the 50% contrast, or you apply a pattern to the screentone generator. You probably have not noticed, but here’s an experience :

Basic gradient :

80% contrast :

100% contrast (just catastrophic for a gradient in my opinion, I don’t recommend that):

If Krita wants to do things on its own, I believe it should consider what exists first, copy it in the measure of possible, and from there you can study the feature and extend/change/improve it before bringing it to Krita. Do you have to reinvent the wheel for everything ? I believe you don’t.
Comparing matters, and since I’m a Windows user, I inform you that, there’s Photoshop and CSP too. Take just these two, not as rivals, but as study subjects.

God bless you.
Thank you for working on this halftone filter. It’s… not too bad.
CSP might be the best study subject if you want to improve it(especially given
that it can in one click convert grays to screentones in the layer properties by default,
and yes, ppi and dot lines per inch, and angle are taken into account).
I would say that it’s an entry point to the development of the
halftone filtering capabilities of Krita.

@Deif_Lou
@raghukamath
By the way, all the tests made here from CSP and Photoshop, use simple round shape for the pattern.

And I chose the same shape in Krita as well for the comparison.

is not a pattern what you want instead of the filter?

Apart from taking into consideration the value of the input image I don’t see any improvement. Infact krita has more feature than CSP. I don’t see how studying it will improve our version. As I have shown, we can generate almost similar halftone in krita itself.

Well it is good to study, nobody is denying that. But why should we copy when we have a flexible option available? Here the issue is that it doesn’t provide a good default from I see, but it doesn’t restrict you in any way.

Well I don’t have anything to say in this matter :slight_smile: You are doing a good job in comparing and studying thank you for that. And due to that we know what is offered in other programs. The only problem in your analysis is the conclusion, that is the suggestion to copy.

There is no rule to keep it 80% or 100% it is for you to decide what value is suitable depending on the situation and get a decent looking tone as a result. For example here is what I got. I tweaked the size, contrast according to my liking.

You change the contrast and other setting if the default is not what you are looking for or if it is not doing a good job. By tweaking a bit you get pretty good results in my opinion.

I chose square and got similar result to that of your CSP and photoshop screenshots.

@Deif_Lou
Honestly I never used the half tone filter but it seems to make diamond shapes you rotate? If you made it all black and erase it with parallel lines with the given angle would it not give more consistent results than creating each entity on every spot?

Don’t take it as copying like “directly bring it to Krita”.
I mean mostly in your lab, while doing experiment on the feature first.
Sorry for not being precise about this.

I edited my reply to include examples too. whatever example you gave I tried to reproduce in Krita and it gave me good result. :man_shrugging:t4:

I am not saying there can’t be improvement. All I suggested was that your request should be towards improving the default results to match the tone.

Your request seems to be to get the exact result you get in CSP and Photoshop by default. Which you can get by some tweaking, in addition you can do more by transform options etc. It is not just limited by the shape like ellipse diamond etc. I can shear rotate to get new pattern. From my point of view this is more powerful than what other software offer.

Note 1: When using the screentone with the halftone filter, the brightness and contrast should be kept at 50% (that gives a smooth screentone pattern from white to black which is the best input for the halftone filter) and the contrast should be adjusted with the hardness parameter of the filter.

Note 2: In CSP and Ps you can not have a smooth and continuous variation of angle and lines per inch like in Krita. If they would allowed it, then the “artifacts” mentioned would appear as well. As I mentioned, 2 different angles or lines per inch values could result in exactly the same pattern, which is kind of weird, and I see it as a weakness.

Note 3: Ps and CSP output aliased patterns. If one wants good looking circles, then smoothing/antialiasing is the way. One can argue that aliased screentone looks better in CSP or Ps than in Krita, but my answer to that is that smooth patterns in Krita look better. I doubt that if someone makes a halftone pattern in a vertor program they disable antialiasing to see jagged edges, so I don’t understand why it should be different in Krita.

Note 4: The tests in Ps and CSP are irrelevant to me in terms of dot shape since they ignore the precise lines per inch and angle set by the user and adjust them just to make the jagged dots look better, as I explained before. Let me say it again: in those programs an angle of 44, 45, 46, and maybe more around 45 degrees, can result in the same screentone image, and that’s wrong in my opinion. That’s also an artifact, some kind of quantization or somethinging like that that they apply just because they don’t have antialiasing. And this is mixed with the kind of adjustment done to the lines per inch, resulting in an unpredictable output. Example: if you have a screentone in CSP with 46 degrees, then if you set 5 lpi, you get a 45 degree pattern; if you change the lpi to 6 you get a different rotation (I guess 46 degrees); if you change lpi to 7 you get again a 45 degree pattern, and so on… you can even have a range of lpi values, say {12, 13, 14} that output the same pattern.
“What existed first” is technology from the 90s or even before so… I bet no one would turn out antialiasing in a game if their computer can handle it, just because aliased rendering existed before. Using aliased edges in halftone is an artifact of the past, like making anime with aliased lines just because they are easier to fill with the bucket tool.
The main classic halftone algorithms output binary images intended to be printed in a black and white printer in the 70s and before.

Note 4: When implementing the screentone generator I was not trying to bring anything from Ps or CSP to Krita. I wanted to bring the traditional, analog, screentone sheets. The main things I considered but left out where the lpi setting, and the accurate representation of the gray tone. The former just because I wanted to finish the filter, and the latter because it is very complex because one has to deal with linear vs non-linear modes, color profiles, and so on. Nevertheless I made the generator so that those features can be easily added once someone knows what the better way of implementing them is.

Note 5: Just like @raghukamath, I think there is room to improve in the lpi setup and the accurate representation of gray tone. I think those are the weaknesses.

@EyeOdin Those diamond patterns are normal if you output aliased edges, just like if you try to paint an aliased tiny circle. That is solved using antialiasing. But Krita’s screentone doesn’t draw circles individualy. It uses a two-dimensional function (the procedural nature of it) to obtain the values, and that’s why it is so fast.

5 Likes

Another set of questions we need to ask ourselves for this is (or any feature for that matter)

  • Does the existing implementation has any limitations in it for getting what I want?
    The answer here is no for this feature.
  • Is the workflow very cumbersome or long to achieve what I want?
    The answer again is no.
  • Is the implementation more flexible than what is already available elsewhere?
    The answer is yes.
  • Is the implemented GUI and workflow being exactly same as other software an important point for me to achieve what I want?
    The answer here is no for this particular feature.

A comic artist can do his work of adding screen tone with the currently available filter without any issue and that is what matters the most.