lazpaint icon indicating copy to clipboard operation
lazpaint copied to clipboard

Add old TV filter

Open lainz opened this issue 5 years ago • 11 comments

Hi, you know that filter like the one used in emulators to give old TV look and feel.

https://www.google.com/search?q=old+tv+filter&source=lnms&tbm=isch

lainz avatar Jun 05 '20 17:06 lainz

Hmm, I am not sure exactly what the filter does.

circular17 avatar Jun 05 '20 20:06 circular17

Is like it blends an image over the background

One of these images maybe: https://www.google.com/imgres?imgurl=https%3A%2F%2Fupload.wikimedia.org%2Fwikipedia%2Fcommons%2Fthumb%2Fc%2Fc1%2FTV_screen_close-up.jpg%2F220px-TV_screen_close-up.jpg&imgrefurl=https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FAnalog_television&tbnid=yFCCtkiDJKQnwM&vet=12ahUKEwiqgff_guzpAhUsM7kGHYuAA64QMygxegQIARAt..i&docid=YNDB694GmFnmZM&w=220&h=206&q=old%20tv%20filter&ved=2ahUKEwiqgff_guzpAhUsM7kGHYuAA64QMygxegQIARAt

lainz avatar Jun 06 '20 01:06 lainz

I did one filter like this some time ago for BGRAControls filters unit, it paints in black odd lines for example. The even lines keep the same.

lainz avatar Jun 06 '20 02:06 lainz

Oh I see. That could be easily done in Python I suppose.

circular17 avatar Jun 06 '20 17:06 circular17

Yes a Python script will be enough. In fact this filter can be anything, is not that specific, you can make it as you want. The thing is to have some old tv look and feel, and that's a bit subjective, depending on the old tv you've seen before =)

lainz avatar Jun 06 '20 22:06 lainz

Indeed. Maybe such filter could have a series of checkboxes with different effects: horizontal lines, noise, grayscale.

circular17 avatar Jun 07 '20 12:06 circular17

I'm thinking on how to code this one. Maybe with a non transparent layer that's blended with a layer blend mode and a layer transparency level. Son the plug in should choose a blend mode by default and the default level of transparency. Then the filter is easy to code just noise color or black and white. TV lines are just a pixel odd drawn completely black and even completely transparent (so noise is visible).

lainz avatar Sep 24 '23 02:09 lainz

I have the filter working in BGRAControls for a long time, check it if you have time: Captura de pantalla 2023-09-23 235916

Is in the folder test/test_bcfilters

lainz avatar Sep 24 '23 03:09 lainz

Yes I think it can be added like another filter. The simpler is to use the same filter connector as other items in render menu. So that would fill a layer. The opacity and blend mode can be handled by the user. One template that can be used is the existing noise filter.

circular17 avatar Sep 24 '23 07:09 circular17

I've tried the sample program and it looks great. I like the zoomy thing, this is a great effect. The way it is programmed is kind of recursive, the bitmap takes itself as an input and changes as the effect is computed. I suppose it is possible to simplify it. From what I see, the result is a sort of zoom blur centered on pixel (0,0).

There are also various filters in it, I imagine two approaches: one is to make multiple filters, and then let the user combine them. Another approach is to a window with multiple filters as in the demo you've provided.

Some filters are colors, others are noise and the zoomy thing is a transform. So I am leaning towards adding these things separatly in LazPaint as fundamental features, or as script. It is always possible then to combine them in a plugin or script.

The are new filters, like the "zoomy" thing and the pixel movement. Those would be great additions!

The noise filter already exists, so one would need to check if something can be added to it.

The "instagram" filters could be done with scripts. Some consists in multiplying by a color, this can be done by adding a layer, fill it with the current back fill, and choose the multiply blend mode. Others use the same channel for red/green/blue making a grayscale image. This can be done by using the filter function and provide for example "red" as a formula for each RGB channel.

What do you think?

circular17 avatar Sep 24 '23 09:09 circular17

Hi. I agree. Multiple filters is the way to go.

lainz avatar Sep 24 '23 11:09 lainz