PDA

View Full Version : Filter development request: FlashTun


Chainmax
24th March 2006, 19:35
I'd like to know if any of the filter developers here could create a filter for me. Its layout would be the following:

- A hardcoded palette of 16 colors (haven't determined them yet, but feedback is welcome).

- The filter would examine each pixel in a frame and compare its RGB or YUV values to the ones on the palette. The pixel would then change its values to the palette color that is closest (still deciding wether to simply use euclidean distance or a more refined algorithm).


It would have two optional parameters:
- After the frame has been altered, the boundary between zones of different colors could be colored with any of the colors from the palette and the boundary could be thickened.
- Applying HQ2X (http://www.hiend3d.com/hq2x.html) to the altered frame (if enabled, it would be used before the boundary coloring/thickening).


P.S: would it be possible to modify the HQnX algorithm to that of a general resizer? If not, could it be possible to at make HQ(1/2)X or HQ(1/4)X?

AVIL
24th March 2006, 21:54
Hi,

In this thread they are some filters you can use:

http://forum.doom9.org/showthread.php?t=99890

at least as test (in the real word, an script with 16 chained ColourStabilise filters could be too slow).

good luck

Chainmax
24th March 2006, 23:33
Some time ago, when I mentioned the possibility of doing it myself, if I recall correctly mg262 pointed me to that same page. It's not exactly whatI'm looking for.

IanB
25th March 2006, 09:46
Some clever use of 16 ColorKeyMasks plus Layer, Overlay, MergeARGB and Show(Alpha, Red, Green & Blue) could be used to build such functionality.

Chainmax
27th March 2006, 14:19
Wouldn't that be too slow?

IanB
27th March 2006, 15:18
Well it would be slower than a custom plugin, but I don't think it would be what you could call slow, all the operations I mentioned are fairly fast. And I would have thought any implementation at this point would be a bonus. I was thinking of this styleConvertToRGB32()
ResetMask()
ColorKeyMasks($123456, 42) # Make colour 1 transparent
M1=ShowAlpha("YV12")
ColorKeyMasks($234567, 42) # Make colours 1 & 2 transparent
M2=ShowAlpha("YV12")
...
ColorKeyMasks($345678, 42) # All colours except remainder are transparent
M15=ShowAlpha("YV12")

# oLay Col 15 over Col 16
Overlay(BlankClip(Last, Color=$FEDCBA),
\ BlankCLip(Last, Color=$DCBA98), Mask=M15, PC_Range=True)
Overlay(BlankCLip(Last, Color=$BA9876), Mask=M14, PC_Range=True) # oLay col 14
...
Overlay(BlankCLip(Last, Color=$654321), Mask=M1, PC_Range=True) # oLay Col 1Perhaps using Layer could be a little faster in this case. I hope this is enough to seed some ideas.

Chainmax
27th March 2006, 16:20
Thanks :).

Chainmax
1st April 2006, 19:36
I don't have the skill to create it myself though. Can someone give it a shot?