GNOME Bugzilla – Bug 625817
coloreffects: new plugin for lookup table color mapping
Last modified: 2010-08-04 08:16:14 UTC
Maps color from the video input to a lookup table, either sampling luma and and looking it up in the table or sampling each color and looking them up in the table. Provides 4 presets for now: Heat camera effect, Sepia toning, Xray (invert colors and make them cyanish), Cross processing. Lookup tables are currently hardcoded, detailed steps to generate them are explained in the code. Would be nice as a future improvement to make them loadable from an image file or even exported Gimp curves. Spin-off from https://bugzilla.gnome.org/show_bug.cgi?id=625722#c17 Answering Sebastian's comments from that bug: All RGB(A/x) combinations are already supported. YUV support would be probably trivial for the luma based mappings (just sample Y and look it up) but quite tricky for the rgb based ones (currently just xpro). I fixed debug handling and changed some string, not sure what polishing it still needs :)
Created attachment 166963 [details] [review] colorlut: new plugin for lookup table color mapping Implements a color lookup table filter with 4 presets: - heat: fake heat camera effect - sepia: sepia toning - xray: invert + shade to blue - xpro: cross process
One minor thing so far: make the tables const :) I'll do a real review later, thanks :)
Ok, the comments now :) - make the tables const - Add support for AYUV at least - Maybe choose a different name... colorlut doesn't say much. Something like colormap or colortransform maybe Also it'd be nice if you could add docs and integrate it into the docs system :)
> - Maybe choose a different name... colorlut doesn't say much. Something like > colormap or colortransform maybe Let's not make it sound too much like a colorspace/pixelformat converter though :-)
(In reply to comment #4) > > - Maybe choose a different name... colorlut doesn't say much. Something like > > colormap or colortransform maybe > > Let's not make it sound too much like a colorspace/pixelformat converter though > :-) Tim, do you have some suggestion? I'm completely lost when it comes to chose a name for something :-P
Same here.. How about: coloreffect? coloreffects?
coloreffects sounds good to me
Created attachment 167054 [details] [review] coloreffects: new plugin for lookup table color mapping Implements a color lookup table filter with 4 presets: - heat: fake heat camera effect - sepia: sepia toning - xray: invert + shade to blue - xpro: cross process
Created attachment 167055 [details] [review] coloreffects: add ayuv support Currently implemented switching from yuv to rgb, looking up rgb from the table in the usual way, getting back to yuv. With luma lookup presets (sepia, heat, xray) a color space conversion is saved directly looking up rgb for a given Y and converting to yuv. Probably this latter step can even be made faster precalculating a luma to yuv table in an outer loop.
About yuv support, converting the luma to rgb tables into luma to yuv ones is pretty simple. Didn't manage to do the same for the rgb to rgb ones (xpro). Maybe I'm too tired or it's the hot summer but could you point me to a way to convert three tables like r' = tabler[r] g' = tableg[g] b' = tableb[b] (which in the code are packed into a single sparse rgb table) into three new tables? y' = tabley[y] u' = tableu[u] v' = tablev[v] (In reply to comment #3) > - make the tables const Done. > - Maybe choose a different name... colorlut doesn't say much. Something like > colormap or colortransform maybe Done. > Also it'd be nice if you could add docs and integrate it into the docs system > :) I'm not that familiar with gtk-doc, the element already contains the annotations, how do I make the doc system aware of it?
(In reply to comment #10) > About yuv support, converting the luma to rgb tables into luma to yuv ones is > pretty simple. Didn't manage to do the same for the rgb to rgb ones (xpro). > Maybe I'm too tired or it's the hot summer but could you point me to a way to > convert three tables like > r' = tabler[r] > g' = tableg[g] > b' = tableb[b] > (which in the code are packed into a single sparse rgb table) > into three new tables? > y' = tabley[y] > u' = tableu[u] > v' = tablev[v] No idea, I have to think about it a bit tomorrow but the way it is done now is good for now and I'll push the changes tomorrow probably... the optimizations can still be done later. > > Also it'd be nice if you could add docs and integrate it into the docs system > > :) > > I'm not that familiar with gtk-doc, the element already contains the > annotations, how do I make the doc system aware of it? I'll do it then, don't worry :)
commit 89231d14d9dadf532b688f19590dd6294c68c218 Author: Sebastian Dröge <sebastian.droege@collabora.co.uk> Date: Wed Aug 4 10:15:00 2010 +0200 coloreffects: Add to the documentation commit 09507edb8c07499f777582a323b66744a68bceca Author: Sebastian Dröge <sebastian.droege@collabora.co.uk> Date: Wed Aug 4 10:11:11 2010 +0200 coloreffects: Minor cleanup commit 43db67f705a9af5875799ca63b5c816d2dcebee3 Author: Sebastian Dröge <sebastian.droege@collabora.co.uk> Date: Wed Aug 4 10:09:53 2010 +0200 coloreffects: Improve property description a bit commit 3878dce20d58253667ada2ac904bfa23bdb2f792 Author: Sebastian Dröge <sebastian.droege@collabora.co.uk> Date: Wed Aug 4 10:08:24 2010 +0200 coloreffects: Don't use the fixed_caps func on the pads coloreffects can renegotiate during playback without any problems. commit 74de641ca4db01d96ddc7db37cfda99f0c16d2d2 Author: Filippo Argiolas <filippo.argiolas@gmail.com> Date: Tue Aug 3 14:39:22 2010 +0200 coloreffects: add ayuv support Currently implemented switching from yuv to rgb, looking up rgb from the table in the usual way, getting back to yuv. With luma lookup presets (sepia, heat, xray) a color space conversion is saved directly looking up rgb for a given Y and converting to yuv. Probably this latter step can even be made faster precalculating a luma to yuv table in an outer loop. https://bugzilla.gnome.org/show_bug.cgi?id=625817 commit 79c343badee269afc423a2c08e99de97eeeb1c0b Author: Filippo Argiolas <filippo.argiolas@gmail.com> Date: Sun Aug 1 23:03:24 2010 +0200 coloreffects: new plugin for lookup table color mapping Implements a color lookup table filter with 4 presets: - heat: fake heat camera effect - sepia: sepia toning - xray: invert + shade to blue - xpro: cross process https://bugzilla.gnome.org/show_bug.cgi?id=625817