Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
10th February 2018, 22:01 | #1 | Link |
Registered User
Join Date: Sep 2006
Posts: 1,657
|
How do I blend pixels in a frame
I have a color palette and I want to blend the edge of every color with the one right next to it so that there's a smooth gradient in the transition. Is there any filter that can do this?
|
10th February 2018, 23:28 | #2 | Link |
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,251
|
Downscale to a width of 8, using point-resize (nearest neighbor), then upscale to a width of 800 again, using your preferred kernel?
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ Last edited by LoRd_MuldeR; 10th February 2018 at 23:30. |
11th February 2018, 00:33 | #3 | Link |
Registered User
Join Date: Sep 2006
Posts: 1,657
|
Thanks it works for width of 8, but when I try to do it with 6 on a six color palette, it gives me an error "Resize error 3076: image shift or subwindow too great"
Code:
image = core.imwrif.Read(r'blend.png') image = core.resize.Point(image, width=6, height=100) blend_image = core.resize.Spline36(image, width=600, height=100) |
11th February 2018, 00:36 | #4 | Link |
Registered User
Join Date: Nov 2009
Posts: 327
|
The 6-tap Spline36 filter is too wide to be used on a 6-pixel image. Either use more colors or choose a narrower filter.
Code:
# Two-stage approach. c = core.std.BlankClip(width=6, height=1) c = core.resize.Spline16(c, width=12, height=1) c = core.resize.Spline36(c, width=600, height=1) # Narrow filter approach c = core.std.BlankClip(width=6, height=1) c = core.resize.Spline16(width=600, height=1) |
11th February 2018, 01:08 | #5 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,580
|
Try a horizontal BoxBlur with many passes?
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
11th February 2018, 02:24 | #6 | Link | |
Registered User
Join Date: Sep 2006
Posts: 1,657
|
Quote:
|
|
Tags |
blending |
Thread Tools | Search this Thread |
Display Modes | |
|
|