After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 625817 - coloreffects: new plugin for lookup table color mapping
coloreffects: new plugin for lookup table color mapping
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
unspecified
Other All
: Normal normal
: 0.10.20
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-08-02 11:05 UTC by Filippo Argiolas
Modified: 2010-08-04 08:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
colorlut: new plugin for lookup table color mapping (26.47 KB, patch)
2010-08-02 11:05 UTC, Filippo Argiolas
none Details | Review
coloreffects: new plugin for lookup table color mapping (27.17 KB, patch)
2010-08-03 16:25 UTC, Filippo Argiolas
committed Details | Review
coloreffects: add ayuv support (8.91 KB, patch)
2010-08-03 16:25 UTC, Filippo Argiolas
committed Details | Review

Description Filippo Argiolas 2010-08-02 11:05:41 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 :)
Comment 1 Filippo Argiolas 2010-08-02 11:05:46 UTC
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
Comment 2 Sebastian Dröge (slomo) 2010-08-02 13:30:04 UTC
One minor thing so far: make the tables const :)

I'll do a real review later, thanks :)
Comment 3 Sebastian Dröge (slomo) 2010-08-03 08:06:52 UTC
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 :)
Comment 4 Tim-Philipp Müller 2010-08-03 09:09:28 UTC
> - 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 :-)
Comment 5 Filippo Argiolas 2010-08-03 09:26:32 UTC
(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
Comment 6 Tim-Philipp Müller 2010-08-03 09:41:02 UTC
Same here..

How about: coloreffect? coloreffects?
Comment 7 Sebastian Dröge (slomo) 2010-08-03 15:03:09 UTC
coloreffects sounds good to me
Comment 8 Filippo Argiolas 2010-08-03 16:25:38 UTC
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
Comment 9 Filippo Argiolas 2010-08-03 16:25:51 UTC
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.
Comment 10 Filippo Argiolas 2010-08-03 16:32:56 UTC
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?
Comment 11 Sebastian Dröge (slomo) 2010-08-03 18:24:16 UTC
(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 :)
Comment 12 Sebastian Dröge (slomo) 2010-08-04 08:16:04 UTC
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