filters in progress

Post unfinished work here for feedback and advise.
Lazur
Posts: 4409
Joined: Tue Jun 14, 2016 10:38 am

Re: filters in progress

Postby Lazur » Tue Oct 31, 2017 11:26 am

halftone filtering template

-click to download the svg-

Image

As easy as that sounds.
This is the filter I was using in the response video here.

Moini
Posts: 2211
Joined: Mon Oct 05, 2015 10:44 am

Re: filters in progress

Postby Moini » Wed Nov 01, 2017 1:41 am

For confusing people less, I'd make the file's background color white transparent, and change the order of the steps, so that tracing is done after moving the bitmap copy somewhere else and removing the filter - else it looks like it's going to be applied twice, once fixed in the bitmap, and once via layer - and while we know that trace bitmap ignores that, it may confuse users.

Yet, a nice and simple - and absolutely functional - tutorial :) Thanks, Lazur, for preparing that with instructions!
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

Lazur
Posts: 4409
Joined: Tue Jun 14, 2016 10:38 am

Re: filters in progress

Postby Lazur » Wed Nov 01, 2017 3:11 am

Thank's for the feedback!

Points taken:
Image


However kept a toned down checkerboard so that transparency is less confusing.
And, with this process it may still be, since the original raster image filtered is rendered below the path.
Maybe invert selection (!)
delete raster image (Del)
select all (Ctrl+A) should be added in before the 3. mentioned step?

Moini
Posts: 2211
Joined: Mon Oct 05, 2015 10:44 am

Re: filters in progress

Postby Moini » Wed Nov 01, 2017 3:41 am

One could add to move it manually, perhaps? 'Grab raster copy and move to the side' or something like that? Or use a fully opaque white background.
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

Raspi
Posts: 186
Joined: Fri Oct 21, 2016 12:51 am

Re: filters in progress

Postby Raspi » Wed Nov 01, 2017 6:31 am

Is it possible to use this template with other patterns ?

It seems to me, the stripes are made of a gradient.

What about the classic halftone dot pattern ?

Lazur
Posts: 4409
Joined: Tue Jun 14, 2016 10:38 am

Re: filters in progress

Postby Lazur » Wed Nov 01, 2017 8:28 am

Raspi wrote:Is it possible to use this template with other patterns ?

It seems to me, the stripes are made of a gradient.

What about the classic halftone dot pattern ?


This template was dedicated to that particular diagonal "hatching" pattern.
To be as "fool proof" as possible.

BUT the basic concept can be used in many other ways.
Not just like zebratrace, but as "liontrace".

The process is the following:
filtered object is broken down to luminance levels,
a base pattern is pulled in which then is modified to represent different lightness values by component transferring
and each of the generated tones are composited with the levels of the original filtered object.

Using a simple gradient is the easiest of all, and without artifacts.
As with the process, the levels of the filtered object doesn't exactly match with the pattern pulled in -resulting in half filled dots and deformed shapes after tracing in a dot pattern -like in this image.

To avoid this, the levels of the filtered object would need to be "re-sampled" to the same raster as the pulled in image.
Haven't quite figured it out myself yet, how to downsample an image with a pixellate filter. My best bet would be zooming in and than out again with displacement map filter primitives.

Another problem with the dot pattern would be some gamma correction of the luminance levels.
Meaning, the linear gradient pulled in into the filter covers each luminance level with the same area. Unlike a radial gradient.

Will try to make a proper dotty halftone sometime.

Raspi
Posts: 186
Joined: Fri Oct 21, 2016 12:51 am

Re: filters in progress

Postby Raspi » Thu Nov 02, 2017 2:45 am

^
This is all over my head, but when you make a duplicate of the diagonal stripes gradient, flip it and set the mode to 'Difference', then apply a Blur and some sort of Levels/Curves, you will get dots, right.

Lazur
Posts: 4409
Joined: Tue Jun 14, 2016 10:38 am

Re: filters in progress

Postby Lazur » Thu Nov 02, 2017 10:28 am

Can generate dots but can't ensure the result will be perfect circle shaped dots unless resampling the image to the same raster as the halftone pattern.
Like it's more evident on this image:
Image
Notice how the bottom left edge of the apple cuts in half the halftone pattern.

Found this example for a pixelate filter. Other examples also use the tile filter primitive which doesn't work at the moment.
(Once it will, then making seamless patterns will also be possible.)
Found this post By Tavmjong mentioning it wasn't working in 2015. Maybe worth a bug report if there isn't one already. Developers are probably well avare of the problem.


Edit:
tried to make one pixelate filter manually with no tile filter primitive with not much outcome.

Concept was to pull in a "mask" with the image filter primitive and composite in every third pixels of the filtered object,
then offsetting the result by 1 px in each direction to have 4 variants and compositing them atop eachother.
Repeat the process with 1 px offsetting of the pulled in image and average the four results into one.

"Sort of" works:
Image
Image

-except when the zoom level is not at 100%, rendering gap issues appear of anti-aliasing

Other notes.
The pulled in "mask" image cannot be a pattern filled object of poor rendering performance. As that pattern would be 2/2 px, it blacks out.
Therefore using two repeating gradient filled objects instead.
With the mentioned process a 1/1 px grid can be downsampled to 2/2 px.
For the 4/4, another mask is necessary on an already processed image and basically repeating the same steps.
Had gone 1 step forward than what's in the screenshot but there was a problem of offsetting somewhere and it is unmanageable to find and correct any errors.

One processing could also work, like, pulling in a mask image with a grid of 5/5 px, with only 1 px opaque out of the 25 and using that for compositing but it takes way more effort and is very error-prone.


Without the downsampling the same problem apply on the pulled in halftone pattern.
For the dots, a 1/1 px square with a radial gradient sqould be converted to a pattern fill, and such a small pattern just glitches.
Maybe if everything was scaled up many times...
Too many compromises, it doesn't fit with a working solution.

Lazur
Posts: 4409
Joined: Tue Jun 14, 2016 10:38 am

Re: filters in progress

Postby Lazur » Wed Nov 15, 2017 1:48 pm

An update to the halftone concept.

Image

Image

Lazur
Posts: 4409
Joined: Tue Jun 14, 2016 10:38 am

Re: filters in progress

Postby Lazur » Thu Nov 16, 2017 7:29 am

Just finished a sayagata/swastika pattern that can make a good use with a halftone template.
Also it was a perfect source for testing woodgrain textures.

Image

Image

Lazur
Posts: 4409
Joined: Tue Jun 14, 2016 10:38 am

Re: filters in progress

Postby Lazur » Tue Nov 28, 2017 3:43 am

Lazur wrote:Can generate dots but can't ensure the result will be perfect circle shaped dots unless resampling the image to the same raster as the halftone pattern.


Still no solution for the resampling.

This time, made a heart-shaped halftone screening template here. Too bad openclipart couldn't render a proper thumbnail with inkscape 0.91...

The screening pattern looks something like this:
Image
Which means a square downsampling would't be suiting either.

Anyway, here is a little something made with the template:
Image

Lazur
Posts: 4409
Joined: Tue Jun 14, 2016 10:38 am

Re: filters in progress

Postby Lazur » Mon Dec 04, 2017 2:50 am

"In action" shot of some of the previous packs.

Image

-This one is actually animated but it takes too much resources to render that I'm not embedding the svg for now.


Return to “Work in progress”

Who is online

Users browsing this forum: No registered users and 1 guest