| View previous topic :: View next topic |
| Author |
Message |
Guest
|
Posted: Mon Jun 16, 2008 2:30 pm Post subject: Why channel decorrelation can improve compression? |
|
|
Hi,
I am trying to understand why channel decorrelation can improve
compression in RGB24 images. Why in general (G, R-G, B-G) would
compress better than (R,G,B)? Can you suggest me any book/web site
where I can read about this?
Thank you for help. |
|
| |
|
Back to top |
cr88192 Guest
|
Posted: Tue Jun 17, 2008 11:33 am Post subject: Re: Why channel decorrelation can improve compression? |
|
|
<danilobrambilla@tiscali.it> wrote in message
news:ef34746f-fab3-4483-991c-879e545f78bf@27g2000hsf.googlegroups.com...
[quote]Hi,
I am trying to understand why channel decorrelation can improve
compression in RGB24 images. Why in general (G, R-G, B-G) would
compress better than (R,G,B)? Can you suggest me any book/web site
where I can read about this?
[/quote]
on average, gray-like colors (including black and white) are a lot more
common than pure colors, and the yellow/green level tends to be a fairly
good estimate of total brightness. as a result, differencing the colors
tends to somewhat reduce the total signal entropy, and may also allow a lot
harsher treatment of these side-bands in lossy compression, allowing the
image to be represented effectively using a lot less information.
> Thank you for help. |
|
| |
|
Back to top |
Guest
|
Posted: Tue Jun 17, 2008 4:15 pm Post subject: Re: Why channel decorrelation can improve compression? |
|
|
On Jun 17, 8:39 pm, Thomas Richter <t...@math.tu-berlin.de> wrote:
[quote]danilobrambi...@tiscali.it wrote:
Hi,
I am trying to understand why channel decorrelation can improve
compression in RGB24 images. Why in general (G, R-G, B-G) would
compress better than (R,G,B)? Can you suggest me any book/web site
where I can read about this?
One can give two reasons, depending on your definition of "compression".
One reason is that it is a property of natural images, i.e. color
channels are highly correlated because typically colors are not very
extreme, and most pixels lie inside the color gammut, showing mostly
variation in luminance, but not very extreme variation in color. One
might say that this is probably because the dyes of nature are never
"perfect" and do not generate pure colors.
[/quote]
Color differencing doesn>t always works nicely. Are there better
methods when goal is just lossless compression?
John |
|
| |
|
Back to top |
Thomas Richter Guest
|
Posted: Tue Jun 17, 2008 8:39 pm Post subject: Re: Why channel decorrelation can improve compression? |
|
|
danilobrambilla@tiscali.it wrote:
[quote]Hi,
I am trying to understand why channel decorrelation can improve
compression in RGB24 images. Why in general (G, R-G, B-G) would
compress better than (R,G,B)? Can you suggest me any book/web site
where I can read about this?
[/quote]
One can give two reasons, depending on your definition of "compression".
One reason is that it is a property of natural images, i.e. color
channels are highly correlated because typically colors are not very
extreme, and most pixels lie inside the color gammut, showing mostly
variation in luminance, but not very extreme variation in color. One
might say that this is probably because the dyes of nature are never
"perfect" and do not generate pure colors.
A second reason is (not independent from the first, of course) is that
our eye is less sensitive to color variation than to luminance variation
(most likely because of the first reason), and for lossy compression,
one can make use of this by representing color information less precise
than luminance information. This requires, of course, that you first
separate chroma from luma, which is exactly the type of decorrelation
transformation you presented.
So long,
Thomas |
|
| |
|
Back to top |
Guest
|
Posted: Tue Jun 17, 2008 11:04 pm Post subject: Re: Why channel decorrelation can improve compression? |
|
|
On Jun 18, 1:29 am, Thomas Richter <t...@math.tu-berlin.de> wrote:
[quote]smithxj...@gmail.com wrote:
On Jun 17, 8:39 pm, Thomas Richter <t...@math.tu-berlin.de> wrote:
danilobrambi...@tiscali.it wrote:
Hi,
I am trying to understand why channel decorrelation can improve
compression in RGB24 images. Why in general (G, R-G, B-G) would
compress better than (R,G,B)? Can you suggest me any book/web site
where I can read about this?
One can give two reasons, depending on your definition of "compression"..
One reason is that it is a property of natural images, i.e. color
channels are highly correlated because typically colors are not very
extreme, and most pixels lie inside the color gammut, showing mostly
variation in luminance, but not very extreme variation in color. One
might say that this is probably because the dyes of nature are never
"perfect" and do not generate pure colors.
Color differencing doesn>t always works nicely. Are there better
methods when goal is just lossless compression?
Sure. One option is the RCT of JPEG2000 which uses better "color
weights", namely
[/quote]
I tried this, it fails if there is even a small amount of noise.
John |
|
| |
|
Back to top |
Thomas Richter Guest
|
Posted: Wed Jun 18, 2008 1:29 am Post subject: Re: Why channel decorrelation can improve compression? |
|
|
smithxjohn@gmail.com wrote:
[quote]On Jun 17, 8:39 pm, Thomas Richter <t...@math.tu-berlin.de> wrote:
danilobrambi...@tiscali.it wrote:
Hi,
I am trying to understand why channel decorrelation can improve
compression in RGB24 images. Why in general (G, R-G, B-G) would
compress better than (R,G,B)? Can you suggest me any book/web site
where I can read about this?
One can give two reasons, depending on your definition of "compression".
One reason is that it is a property of natural images, i.e. color
channels are highly correlated because typically colors are not very
extreme, and most pixels lie inside the color gammut, showing mostly
variation in luminance, but not very extreme variation in color. One
might say that this is probably because the dyes of nature are never
"perfect" and do not generate pure colors.
Color differencing doesn>t always works nicely. Are there better
methods when goal is just lossless compression?
[/quote]
Sure. One option is the RCT of JPEG2000 which uses better "color
weights", namely
(r + 2g + b) / 4 -> y
b - y -> cb
r - y -> cr
which can be seen to be reversible. MS proposes a "YCbCo"
transformation, which works AFAIK as follows:
b - r -> v
g - r - (v+1)/2 -> u
g - (u/2) -> y
Here the "u" coordinate is approximately g - (r + b) / 2, and thus y is
again approximately g/2 + r/4 + b/4 as above, but u and v are "rotated"
compared to the standard YCbCr in the sense that v is approximately the
difference between Cb and Cr, and u is approximately its average.
I haven>t tried to how well that works compared to the above, or if it
works substantially better. You may want to try yourself. I>m certainly
interested in your findings.
So long,
Thomas |
|
| |
|
Back to top |
Marco Al Guest
|
Posted: Wed Jun 18, 2008 7:50 am Post subject: Re: Why channel decorrelation can improve compression? |
|
|
danilobrambilla@tiscali.it wrote:
[quote]I am trying to understand why channel decorrelation can improve
compression in RGB24 images. Why in general (G, R-G, B-G) would
compress better than (R,G,B)? Can you suggest me any book/web site
where I can read about this?
[/quote]
Decorrelation is tied to the hip with energy compaction. By putting most
of the energy in a single channel you are making it more efficient to
code the channels independently. It>s just a very small transform, so
just look up transform coding in any decent data compression book.
Regards,
Marco |
|
| |
|
Back to top |
Marco Al Guest
|
Posted: Wed Jun 18, 2008 7:51 am Post subject: Re: Why channel decorrelation can improve compression? |
|
|
smithxjohn@gmail.com wrote:
[quote]Color differencing doesn>t always works nicely. Are there better
methods when goal is just lossless compression?
[/quote]
Don>t treat the channels as independent? :)
Regards,
Marco |
|
| |
|
Back to top |
Guest
|
Posted: Wed Jun 18, 2008 10:04 am Post subject: Re: Why channel decorrelation can improve compression? |
|
|
[quote]
Sure. One option is the RCT of JPEG2000 which uses better "color
weights", namely
(r + 2g + b) / 4 -> y
b - y -> cb
r - y -> cr
[/quote]
This one works far better than (G, R-G, B-G) for my algorithm. Do you
think I can use it without patent issues?
Thank you for help :-P |
|
| |
|
Back to top |
cr88192 Guest
|
Posted: Wed Jun 18, 2008 11:01 am Post subject: Re: Why channel decorrelation can improve compression? |
|
|
<smithxjohn@gmail.com> wrote in message
news:783bda76-23c1-4b72-a127-79bc7cb7456d@w4g2000prd.googlegroups.com...
On Jun 18, 1:29 am, Thomas Richter <t...@math.tu-berlin.de> wrote:
<snip>
[quote]
I tried this, it fails if there is even a small amount of noise.
John
[/quote]
of misc note:
often, there may be little "tricks" when doing the inverse transform in
order to make them lossless (such as working with "phantom" low order bits
and similar).
unless one knows the trick (if there is one), then they wont be entirely
lossless, but if one does the tricks, then they will work correctly.
I can>t say what the trick is exactly in these cases, since I have not
worked with those exact decorellations.
checking:
y = (r + 2g + b) / 4
u = b - y
v = r - y
inverting:
r = v + y
b = u + y
g = (4y - r - g) / 2
so, the question is then if the low bits in G are exact:
r=1 g=1 b=1
y=1 u=0 v=0
r=1 b=1 g=1
in this case, it holds...
a few more and it could be verified... |
|
| |
|
Back to top |
Guest
|
Posted: Wed Jun 18, 2008 2:29 pm Post subject: Re: Why channel decorrelation can improve compression? |
|
|
[quote]
Yes, to my very knowledge, this one is not only licence-fee-free, but also
licence free (I would be astonished if someone could patent this...).
[/quote]
GREAT! My little garage-spare-time-coded compression algorithm is
getting very very close to JPEG-LS compression level with this :-PP |
|
| |
|
Back to top |
Thomas Richter Guest
|
Posted: Wed Jun 18, 2008 7:01 pm Post subject: Re: Why channel decorrelation can improve compression? |
|
|
smithxjohn@gmail.com schrieb:
[quote]
Color differencing doesn>t always works nicely. Are there better
methods when goal is just lossless compression?
Sure. One option is the RCT of JPEG2000 which uses better "color
weights", namely
I tried this, it fails if there is even a small amount of noise.
[/quote]
Please define "it fails". For me, it works perfectly.
(Not that one should expect major improvements due to the RCT, it>s only
a tiny extra).
So long,
Thomas |
|
| |
|
Back to top |
Thomas Richter Guest
|
Posted: Wed Jun 18, 2008 7:02 pm Post subject: Re: Why channel decorrelation can improve compression? |
|
|
danilobrambilla@tiscali.it schrieb:
[quote]Sure. One option is the RCT of JPEG2000 which uses better "color
weights", namely
(r + 2g + b) / 4 -> y
b - y -> cb
r - y -> cr
This one works far better than (G, R-G, B-G) for my algorithm. Do you
think I can use it without patent issues?
[/quote]
Yes, to my very knowledge, this one is not only licence-fee-free, but also
licence free (I would be astonished if someone could patent this...).
So long,
Thomas |
|
| |
|
Back to top |
Thomas Richter Guest
|
Posted: Wed Jun 18, 2008 8:54 pm Post subject: Re: Why channel decorrelation can improve compression? |
|
|
danilobrambilla@tiscali.it schrieb:
[quote]Yes, to my very knowledge, this one is not only licence-fee-free, but also
licence free (I would be astonished if someone could patent this...).
GREAT! My little garage-spare-time-coded compression algorithm is
getting very very close to JPEG-LS compression level with this :-PP
[/quote]
If so, please compare yours with JPEG-LS equipped with RCT to have an apples to
apples comparison.
So long,
Thomas |
|
| |
|
Back to top |
Guest
|
Posted: Thu Jun 19, 2008 8:28 am Post subject: Re: Why channel decorrelation can improve compression? |
|
|
[quote]
If so, please compare yours with JPEG-LS equipped with RCT to have an apples to
apples comparison.
[/quote]
Yes, this is what i did. I can see that using (G, R-G, B-G) or
JPEG2000 RCT before JPEG-LS doesn>t effect very much JPEG-LS
compression (I am using JPEG-LS Photoshop plug-in from HP, as it let
you choose the RCT you want in a pool of 5-6.
Instead for my algorithm it seems to be more effective. I have to do
more testing but it seems to be a great improvement in my case. Hope
no errors somewhere :-P |
|
| |
|
Back to top |
|