Lossless JPEG?

855 views
Skip to first unread message

samu

unread,
Apr 6, 2010, 11:37:29 PM4/6/10
to OpenJPEG
Hi,
Can the OpenJPEG library help me import lossless JPEG/JFIF files?

When I try to open these files in Adobe Photoshop, I get the error
message
"Could not complete your request because reading spatial/lossless JPEG
files is not implemented."

If not, what other open source libraries can I use to read lossless
JPEG/JFIF files?

Bob Friesenhahn

unread,
Apr 7, 2010, 10:46:10 AM4/7/10
to samu, OpenJPEG
On Tue, 6 Apr 2010, samu wrote:

> Hi,
> Can the OpenJPEG library help me import lossless JPEG/JFIF files?

No, because it is for JPEG 2000 rather than original JPEG/JFIF. You
need IJG JPEG 6b with the addition of the lossless JPEG source patches
from
"ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/delegates/ljpeg-6b.tar.gz".

Bob
--
Bob Friesenhahn
bfri...@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/

Mathieu Malaterre

unread,
Apr 7, 2010, 10:57:04 AM4/7/10
to open...@googlegroups.com, samu
On Wed, Apr 7, 2010 at 4:46 PM, Bob Friesenhahn
<bfri...@simple.dallas.tx.us> wrote:
> On Tue, 6 Apr 2010, samu wrote:
>
>> Hi,
>> Can the OpenJPEG library help me import lossless JPEG/JFIF files?
>
> No, because it is for JPEG 2000 rather than original JPEG/JFIF.  You need
> IJG JPEG 6b with the addition of the lossless JPEG source patches from
> "ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/delegates/ljpeg-6b.tar.gz".

The original patch (from oceana) is bogus, check ljpeg at:

http://jpeg.sf.net ->
http://sourceforge.net/apps/mediawiki/jpeg/index.php?title=Main_Page

Or to some extent I think you can use pvrg

eg:
http://packages.qa.debian.org/p/pvrg-jpeg.html

HTH
--
Mathieu

Bob Friesenhahn

unread,
Apr 7, 2010, 11:17:06 AM4/7/10
to Mathieu Malaterre, open...@googlegroups.com
On Wed, 7 Apr 2010, Mathieu Malaterre wrote:
>
> The original patch (from oceana) is bogus, check ljpeg at:

In what way is it bogus (honest question)?

It seems that there are quite a few competing variants of IJG JPEG
now. Besides the ones listed in this Wiki, official IJG JPEG is now
up to release 8a, still lacks lossless support, and seems highly
unlikely to ever support it. Debian Linux (and others) have been
eager to get started on the upgrade track to IJG JPEG 8a.

Mathieu Malaterre

unread,
Apr 7, 2010, 11:38:30 AM4/7/10
to Bob Friesenhahn, open...@googlegroups.com
On Wed, Apr 7, 2010 at 5:17 PM, Bob Friesenhahn
<bfri...@simple.dallas.tx.us> wrote:
> On Wed, 7 Apr 2010, Mathieu Malaterre wrote:
>>
>> The original patch (from oceana) is bogus, check ljpeg at:
>
> In what way is it bogus (honest question)?

I -honestly- do not remember. This was done ages ago. If you have time
and intest compare the 'official ijg6b+lossless patch':

svn co http://jpeg.svn.sourceforge.net/svnroot/jpeg/ljpeg/

with what I had to do in GDCM (this contains ijg6b+lossless+bug for
signed short + lossless bug):

svn co http://gdcm.svn.sourceforge.net/svnroot/gdcm/trunk/Utilities/gdcmjpeg

I believe DCMTK also contains a patched ijg6b+lossless patch

>> http://jpeg.sf.net ->
>> http://sourceforge.net/apps/mediawiki/jpeg/index.php?title=Main_Page
>
> It seems that there are quite a few competing variants of IJG JPEG now.
>  Besides the ones listed in this Wiki, official IJG JPEG is now up to
> release 8a, still lacks lossless support, and seems highly unlikely to ever
> support it.

This is also my understanding.

> Debian Linux (and others) have been eager to get started on the
> upgrade track to IJG JPEG 8a.

Yup. But those people only really care about lossy 8bits. I think 8a
is somewhat backward compatible in that sense.

--
Mathieu

samu

unread,
Apr 7, 2010, 4:44:15 PM4/7/10
to OpenJPEG
Hi,
Thanks all for the info. I got the IJG JPEG 6b + lossless patch
compiled, but it still does not
read this particular JPEG/JFIF format. It was created by PaintShopPro
X2.

I get back the following error from jpeglib:
"Invalid lossless parameters Ss=1 Se=63 Ah=0 Al=0"

Reply all
Reply to author
Forward
0 new messages