Newspaper plugin for halftoning

ah :sweat_smile:

I changed to “What is Newspaper plugin?”
:wink:

Grum999

wow thanks,
I tried in windows 10 it works perfectly.

Cool work :slight_smile: thanks for the plug-in.

Thanks for information :+1:

Thanks :grinning:

Grum999

Love it! Could be very useful!

Might it be worth it for you to rewrite this plugin in cpp, so we can use it to replace the current halftone filter? The bugs it has is because when I worked on it, I tried to make it multi-threaded (so it could be used as a filterlayer), but that kinda failed.

Hi @wolthera

I agree that using C++ for this plugin would be great for performances (and for Krita also, to have this natively in filters :wink: ), but for now I’m not just able to do it.

I already tried to understand code from krita/plugins/filters/halftone/kis_halftone_filter.cpp file because it’s not working properly when called from PyKrita API, but for now even if I’m able to understand the code in his globality, as I already told to @tiar I think I’ve some step to pass before starting to work on Krita’s source code:

  • I’m relatively a newbie with C++ language
  • I need to understand Krita’s dedicated Kis* classes and architecture
  • I need to learn Qt a little bit more (with this plugin I think I now have some basis, but not enough, and working on python plugin with PyQt is easier for me to learn Qt concept than trying to learn Qt and C++ at the same time)
  • I need to learn how to use git (ok I’ve already started this point :wink: )
  • I need to be able to compile Krita (next step after git learning, should not be so difficult, but it’s another step to learn)
  • I need time (I currently have 2 more plugins in my mind and I want to be able to work on them before really starting C++)

So for now we will have do with the python plugin, waiting to have something better in Krita’s native filters, I think it’s a nice workaround :wink:

And in few month I’ll try to work on a C++ version of the plugin, but before I think I need to try to fix one or two bug that @tiar listed as they’re defined as ‘relatively easy’.

But as you can see the plugin provides many options and it won’t be just trying to fix problem with current halftone filter, it make sense to code the plugin with C++ only if all current plugin functionalities and options are reported in C++

In any case, the fact you asked me to rewrite the plugin as a native C++ to be part of Krita touches me and comforts me on the quality of the plugin :slight_smile:

Grum999

I don’t think you should aim so high… I haven’t achieved it yet and I’m still being useful :stuck_out_tongue: Just run

grep -Rn "search phrase"

in the source directory and you’re good to go :stuck_out_tongue: (I need to make a blog post about tips for developing on Krita, looks like it might be useful)

Not saying it’s unnecessary, but git commands are something that one can give you if needed. Also there is this guide: https://docs.krita.org/en/untranslatable_pages/intro_hacking_krita.html#contributing-patches which basically contains everything except for applying patches provided by other people (I need to include that, too :wink: and finally move to its own page…)

It could be a separate halftone filter, like there are two Blur ones. Or it could replace the old one if there is no usecases where the old one is better.

Of course I’m not saying that you should right now start to write it in c++ and be done in a week :slight_smile: I’m happy you consider contributing, and I just thought it would be good to reduce some of your worries, that’s all. Having it as a plugin already looks really useful :slight_smile:

2 Likes

Thanks :slightly_smiling_face:

Yes there’s some worries, especially because when I don’t have mastery about what I’m doing or when I don’t really understand what I’m doing, I’m afraid to make mistake and broke something, and finally I have no pleasure to do it.
So this is why I prefer to (slowly) learn a minimum before starting to really contribute :wink:

Grum999

1 Like

That’s why I like this website, you get things like this being created. I couldn’t get the plugin to work so I downloaded the latest version of Krita. I’m on Windows 8.1, now it works. I did a test with Newspaper, in combination with Channels2Layers script, so I did a newspaper operation on each color output and used the color picker in the monochrome setting to get my CMY tone layers and combined them with multiply modes.

I need to experiment more with this plugin and get to know it better, but so far it’s really inspiring me.

Hi!

To work, the plugin needs Krita 4.2.9 due to some code that need Python 3.8
Maybe I can made some change to let him being compatible with Krita 4.2.8, I need to check what to do for this…

In fact, the plugin Newspaper allows to to work directly on CMYK colors without having to use Colors2Channels; there’s 3 dedicated modes for this :wink:
There’s a small description in initial post, but as it’s a collapsible section maybe it’s not really visible (need to click on ‘Detailed options description’)

The plugin will split the C,M,Y+K channels automatically and will apply the right screen angle to each color properly to reduce “moiré” effect.

Grum999

During my development tests I was wondering how you was able to keep proper clean black lines, because on my side if we really decompose CMYK from a flat image, the black lines are not so clean as before due to the halftone… (this why I tried to create the “Four color (CMY+K - Comics #1)” and “Four color (CMY+K - Comics #2)” modes :slight_smile:

But if I understood, you apply halftone on a dedicated colored layer (without black) and keep the original clean black line above?

Grum999

Yes correct, I keep the black ink layer separate. I can’t remember why I felt it necessary to go with Channels2layers, I used it the way you said first before I went ahead to do it my way. I think the result color match wasn’t as close to the original or something, (from memory I think when I took out the K layer it removed a lot of the color depth and looked washed out) but I will play around with the default some more and see if I can get the results I’d like. Thanks for doing this, it just gives us more options within Krita.

PS didn’t see the collapsible section in original post, that info is important and I probably didn’t choose a good mode, so I’ll give all that a good read and experiment more.

In fact, by applying an halftone effect to each CMY color channels will provide a washed out effect, it’s not possible to get the original as dots are separated with blank (this visual example might be better than my explanation :slight_smile:)

But if you’re working on pure colored layer, without any black value, I may need to add a “Three Color (CMY)” mode that will provide better results, because the actual 3 colors mode implemented “remove” the black key information from color before processing.

You can also try to play with the “adjusment” option, that allow to change the distance between dots (so, less blank means more color intensity…)

If you want, you can send me a version of your drawing (one layer black, one colored, and do not need full size) to do development tests on it as a reference…

Grum999

Thanks, I’m playing around ATM, and your Three Color option sounds like a good one to me.

You can combine these two images into kra file for testing if it helps.


Thanks for the files :slight_smile:

I’ve made a quick test with a 3 colors CMY implementation:

  • Working with a separate color layer provide in any case better results than trying to isolate the black key
  • The result with CMY instead of CMYK seems to be better!

Here 3 example of what I got:
Dot Size = 5px


Dot Size = 7px

Dot Size = 6px / Adjustment = -10%

The last one provide more saturated colors.
I think it’s possible to got better results with a better configuration of dot size and adjustment values, but for now I don’t have the time to play more…

based from your drawing, I will try to see if I can made optimized modes, but in any case I think to publish the version with “Three color (CMY)” mode tomorrow (not sure to have time today/tonight)

Grum999

1 Like

Oh yeah, you really solved it.

1 Like

Yes it seems :blush:

Version 1.1.0 has been published (I’ve updated main thread of this topic)

Here the last results I got with your drawing:

All tests made with the following parameters:
Dot size: 6.5px
Adjustment: -10%
Sampling: high

Mode: Three color (CMY - Pictures) / Applied on color layer

Mode: Four color (CMYK - Pictures) / Applied on color layer

Mode: Four color (CMY+K - Pictures) / Applied on color layer

Mode: Four color (CMY+K - Comics #2) / Applied on merged black lines + color layer


Fot his last one, the result is quite good I think as it’s not easy to separate the black lines properly (for this we need a good quality image like one you’ve provided: large size, no JPEG artifacts, proper black line with a good separation with color)

Grum999

1 Like

Stella work. I’ve been thinking about this and what could be useful would be a save settings option for the plugin. If one has a tone setting that they find works on a project, then being able to load those in would speed up things. ATM you’d have to write those numbers down.

Anyway, something to think about, the plugin is really good as it is.

What a cool plugin!!

I can confirm that works perfectly fine in MacOS Catalina.

Hi

Thanks for information!

And glad you like the plugin :wink:

Grum999