Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

JPEG Lossless compression verify
Hi there,

I'm just newbie on this, and probably things aren`t as easy as it
seemed to be, but I would like to know HOW can us assure that some
compression process made is actually a lossless process in the JPEG
images in  the hole sense of the words. Thats is, is just a "visually
lossless" result as someone has told to me, and, in that case, how can
someone assure that any image has no visual lost. Or there is really
"mathematically lossless" results and then the original image and the
compressed&decompressed one should be identical bit-to-bit. Thats
really important for me 'cause I need to check if my compression
results are really in a lossless manner.

Thanks for advanced, and sorry for the annoyances.

see ya,
Carmelo

Report this thread to moderator Post Follow-up to this message
Old Post
Carmelo
09-10-04 08:55 PM


Re: JPEG Lossless compression verify
Hi,

> I'm just newbie on this, and probably things aren`t as easy as it
> seemed to be, but I would like to know HOW can us assure that some
> compression process made is actually a lossless process in the JPEG
> images in  the hole sense of the words. Thats is, is just a "visually
> lossless" result as someone has told to me, and, in that case, how can
> someone assure that any image has no visual lost. Or there is really
> "mathematically lossless" results and then the original image and the
> compressed&decompressed one should be identical bit-to-bit. Thats
> really important for me 'cause I need to check if my compression
> results are really in a lossless manner.

"Visually lossless" is possibly a slang invented by marketing
directors. Otherwise, you need to specify the loss quantitatively,
i.e. measure it.

Concerning a suitable measure, here's the simplest possible:
Compute the sum of the square error between the original image and
the compressed/recompressed as this:

MSE = \sum_{x,y \in image} (original(x,y) - reconstructed(x,y))^2

Then normalize by the size of the image to get the average error per
pixel, and normalize again by the dynamical range of the image, i.e.
255^2 for an 8bpp image:

mse = MSE / (width * height * 255^2)

Ten times the logarithm of the inverse of this is called the "PSNR"
(Peak signal to noise ratio) and the simplest, but widely accepted
noise/quality measure:

PSNR = 10 * log_10 1/mse

Two kinds of image compressions are available, lossy and lossless. Lossy
introduces errors but tries to minimize the visual error (e.g. by trying
to minimise the PSNR and ignoring that the two things differ), lossless
does not introduce *any* error, i.e. the PSNR is infinite = mse is zero =
mathematical precise reconstruction. There are also lossless image
compression methods (PNG, JPEG-LS) similar to lossy ones (JPEG,JPEG2000).

So long,
Thomas

Report this thread to moderator Post Follow-up to this message
Old Post
Thomas Richter
09-10-04 08:55 PM


Re: JPEG Lossless compression verify
"Carmelo" <carmelo8888@yahoo.com> wrote in message
news:78636542.0409100559.58fbc05d@posting.google.com...
> Hi there,
>
> I'm just newbie on this, and probably things aren`t as easy as it
> seemed to be, but I would like to know HOW can us assure that some
> compression process made is actually a lossless process in the JPEG
> images in  the hole sense of the words. Thats is, is just a "visually
> lossless" result as someone has told to me, and, in that case, how can
> someone assure that any image has no visual lost. Or there is really
> "mathematically lossless" results and then the original image and the
> compressed&decompressed one should be identical bit-to-bit. Thats
> really important for me 'cause I need to check if my compression
> results are really in a lossless manner.
>
> Thanks for advanced, and sorry for the annoyances.
>
lossy jpeg is intended to be "visually lossless", but is still lossy in the
mathematical sense.

lossless jpeg would be mathematically lossless, otherwise it couldn't be
called lossless (even if only rarely does a value not match exactly, it
would still be lossy, eg since mismatch is still a possibility).

however, someone who knows more would likely be a better authority on this.




Report this thread to moderator Post Follow-up to this message
Old Post
cr88192
09-10-04 08:55 PM


Re: JPEG Lossless compression verify
There is a special lossless mode in the original JPEG definition, although
it is not very widely in use, and it is also patented.

This lossless method looks a bit like wavelets already since it stores plane
gradients first and then encodes the differences to these (IIRC).

Kind regards,

Nils Haeck

PS JPeg2000 has a lossless mode as well.

"cr88192" <cr88192@remove.hotmail.com> wrote in message
news:GLi0d.1231$qT2.792@news.flashnewsgroups.com...
>
> "Carmelo" <carmelo8888@yahoo.com> wrote in message
> news:78636542.0409100559.58fbc05d@posting.google.com... 
> lossy jpeg is intended to be "visually lossless", but is still lossy in
the
> mathematical sense.
>
> lossless jpeg would be mathematically lossless, otherwise it couldn't be
> called lossless (even if only rarely does a value not match exactly, it
> would still be lossy, eg since mismatch is still a possibility).
>
> however, someone who knows more would likely be a better authority on
this.
>
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
Nils
09-12-04 01:55 AM


Re: JPEG Lossless compression verify
"Nils" <nospam@chello.nl> wrote in message
news:o3L0d.13099$zh.10365@amsnews02.chello.com...
> There is a special lossless mode in the original JPEG definition, although
> it is not very widely in use, and it is also patented.
>
> This lossless method looks a bit like wavelets already since it stores
plane
> gradients first and then encodes the differences to these (IIRC).
>
> Kind regards,
>
> Nils Haeck
>
> PS JPeg2000 has a lossless mode as well.
>

The patents only apply to the arithmetic encoding. You can use Huffman
encoding just as in the lossy modes.
Moreover, there are no gradients encoded. Only the differences from the
values predicted by the chosen model (seven different models) are encoded.

Carsten Hansen



Report this thread to moderator Post Follow-up to this message
Old Post
Carsten Hansen
09-12-04 08:55 AM


Re: JPEG Lossless compression verify
"Nils" <nospam@chello.nl> wrote in message
news:o3L0d.13099$zh.10365@amsnews02.chello.com...
> There is a special lossless mode in the original JPEG definition, although
> it is not very widely in use, and it is also patented.
>
> This lossless method looks a bit like wavelets already since it stores
> plane
> gradients first and then encodes the differences to these (IIRC).
>
> Kind regards,
>
> Nils Haeck
>
> PS JPeg2000 has a lossless mode as well.
>
yes, however when many think of jpeg, they typically think of the lossy
version (actually it annoys me sometimes that many people seem to think that
"all" graphics/audio/video compression is lossy, instead of just most).

I was trying to distinguish them, but this meaning may have been lost.

of course, I am also kind of a newb to compression though (eg: I have not
written that many styles of compressor, and less that actually work). more
often I just seem to end up relying on things like zlib and jpeglib (or
altering an existing arith coder to work, eg, as I couldn't get mine to
work).
this is since the workings of the algos are hard to understand sometimes and
harder to get working. of course, this does hurt my confidence some.

> "cr88192" <cr88192@remove.hotmail.com> wrote in message
> news:GLi0d.1231$qT2.792@news.flashnewsgroups.com... 
> the 
> this. 
>
>




Report this thread to moderator Post Follow-up to this message
Old Post
cr88192
09-12-04 08:55 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Compression archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:10 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.