You are viewing a plain text version of this content. The canonical link for it is here.
Posted to sanselan-dev@incubator.apache.org by Carsten Ziegeler <cz...@apache.org> on 2008/04/08 09:35:07 UTC
JPEG Support
Just curious, what needs to be done to get full jpeg support? Are there
any legal problems?
Carsten
--
Carsten Ziegeler
cziegeler@apache.org
Re: JPEG Support
Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
That was part of the pre-incubation discussions although I think none of
the Harmony devs was directly involved. In the meantime, Harmony has
integrated libpng and libjpeg (both native) as ImageIO codecs so they
are more or less on the same level as the Sun JVM (although the ImageIO
API itself isn't fully implemented, yet, which is why FOP currently
doesn't work with Harmony). So they probably don't have any need for
Sanselan. For them, the "pure Java" argument is also not so important as
for me, for example, as they have to deal with native code on a much
larger scale anyway.
On 14.04.2008 09:33:17 Jukka Zitting wrote:
> Hi,
>
> On Sun, Apr 13, 2008 at 11:17 AM, Jeremias Maerki
> <de...@jeremias-maerki.ch> wrote:
> > If there's any relationship between ImageIO and Sanselan it's that at some point
> > it makes sense to write ImageIO codec adapters for all codecs in Sanselan.
>
> Has there been any discussion about using Sanselan to provide ImageIO
> codecs for Harmony?
>
> BR,
>
> Jukka Zitting
Jeremias Maerki
Re: JPEG Support
Posted by Philipp Koch <ph...@day.com>.
i don't agree with jeremias in some points because sanselan proved to
me very helpful in many cases especially for tiff handling for which i
couln't find another good library. also the quick retrieval of a
BufferedImage from many of the image types (unfortunately not from
jpeg) is very cool. imageIO is ok in many cases for jpeg handling, but
lacks of some special (e.g. adobe) jpeg support. having jpeg supported
in the sanselan project would:
- ease of fixing bugs like the above mentioned missing adobe jpeg
(inline pdf images) issue.
- make the sanselan lib THE image library to use for image operations
(so you do not have to worry about using the "right" library)
regards,
philipp
On Sun, Apr 13, 2008 at 10:17 AM, Jeremias Maerki
<de...@jeremias-maerki.ch> wrote:
> Kind'a beats the purpose of Sanselan if you ask me. If you just want to
> load JPEGs and extract some metadata you can just as well use
> javax.imageio directly. If there's any relationship between ImageIO and
> Sanselan it's that at some point it makes sense to write ImageIO codec
> adapters for all codecs in Sanselan. At least, that would be the first
> thing I'd write if we had a pure-Java JBIG2 and/or JPEG codec inside
> Sanselan. Until then I personally don't even have a reason to use
> Sanselan at all because ImageIO (plus JAI Image I/O Tools) gives me
> everything I need. (Sorry, Charles)
>
>
>
> On 12.04.2008 19:50:29 Carsten Ziegeler wrote:
> > Hi Charles,
> >
> > Charles Matthew Chen wrote:
> > > Hi Carsten,
> > >
> > > I don't know of existing jpeg code we could use.
> > >
> > What about the javax.image stuff? Can't we somehow use that?
> >
> >
> > Carsten
> >
> >
> > --
> > Carsten Ziegeler
> > cziegeler@apache.org
>
>
>
>
> Jeremias Maerki
>
>
Re: JPEG Support
Posted by Jukka Zitting <ju...@gmail.com>.
Hi,
On Sun, Apr 13, 2008 at 11:17 AM, Jeremias Maerki
<de...@jeremias-maerki.ch> wrote:
> If there's any relationship between ImageIO and Sanselan it's that at some point
> it makes sense to write ImageIO codec adapters for all codecs in Sanselan.
Has there been any discussion about using Sanselan to provide ImageIO
codecs for Harmony?
BR,
Jukka Zitting
Re: JPEG Support
Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Kind'a beats the purpose of Sanselan if you ask me. If you just want to
load JPEGs and extract some metadata you can just as well use
javax.imageio directly. If there's any relationship between ImageIO and
Sanselan it's that at some point it makes sense to write ImageIO codec
adapters for all codecs in Sanselan. At least, that would be the first
thing I'd write if we had a pure-Java JBIG2 and/or JPEG codec inside
Sanselan. Until then I personally don't even have a reason to use
Sanselan at all because ImageIO (plus JAI Image I/O Tools) gives me
everything I need. (Sorry, Charles)
On 12.04.2008 19:50:29 Carsten Ziegeler wrote:
> Hi Charles,
>
> Charles Matthew Chen wrote:
> > Hi Carsten,
> >
> > I don't know of existing jpeg code we could use.
> >
> What about the javax.image stuff? Can't we somehow use that?
>
>
> Carsten
>
>
> --
> Carsten Ziegeler
> cziegeler@apache.org
Jeremias Maerki
Re: JPEG Support
Posted by Endre Stølsvik <On...@stolsvik.com>.
Charles Matthew Chen wrote:
> Hi Carsten,
>
> I don't know of existing jpeg code we could use.
You do have open source C code. C is not Java, but it does mean that you
could basically translate the code, instead of having to read the spec
and design the entire thing from scratch.
For JPEG:
The IJG code, C, "BSD style with acknowledge clause":
(The ijg.org site was apparently down today.)
Stanford PVRG, C, Public Domain, "don't blame us":
http://www.panix.com/~eli/jpeg/
About these:
http://www.faqs.org/faqs/jpeg-faq/part2/section-15.html
For JPEG 2000 (which should be used way more!):
JPEG 2000, C, BSD license:
http://www.openjpeg.org/
JasPer, C, BSD style license:
http://www.ece.uvic.ca/~mdadams/jasper/
JJ2000 (Java reference implementation of JPEG 2000), strange license
(only talks about the copyright), but looks like one can use it):
http://jj2000.epfl.ch/jj_download/index.html
http://jpeg2000.epfl.ch/
Endre.
Re: JPEG Support
Posted by Carsten Ziegeler <cz...@apache.org>.
Hi Charles,
Charles Matthew Chen wrote:
> Hi Carsten,
>
> I don't know of existing jpeg code we could use.
>
What about the javax.image stuff? Can't we somehow use that?
Carsten
--
Carsten Ziegeler
cziegeler@apache.org
Re: JPEG Support
Posted by Charles Matthew Chen <ch...@gmail.com>.
Hi Carsten,
I don't know of existing jpeg code we could use.
Charles.
On Thu, Apr 10, 2008 at 1:28 PM, Carsten Ziegeler <cz...@apache.org> wrote:
> Ok, thanks for all the answer! So it seems that we *could* do it, but its a
> lot of work. I would really love to have full jpeg support in sanselan - atm
> I don't care about performance.
>
> Would it be possible to use any existing stuff?
>
> Carsten
>
>
>
> Endre Stølsvik wrote:
>
> > Charles Matthew Chen wrote:
> >
> > > Hi,
> > >
> > > My personal feeling about implementing JPEG:
> > >
> > > * not sure if there is a patent issue.
> > >
> >
> > There aren't any (anymore). Trust me: It'd be heard about by now.
> >
> >
> > > * a pure-java implementation will always be slower than a native
> > > (c/c++) implementation.
> > >
> >
> > Of course. And much better than a JNI solution, with its inherit dangers
> and noncompatiblity.
> >
> >
> > >
> > > There might be virtue in adding pure-Java jpeg decode/encode
> > > support to Sanselan, but the case is hard to make. People use JPEG in
> > > a different way than other formats. They use it for large collections
> > > of large images. Performance matters. Users are going to turn to a
> > > native implementation. Why rewrite the excellent and mature libjpeg?
> > >
> > > Its hard to imagine us even doing better (in terms of stability,
> > > maturity and performance) than ImageIO or JAI, which are readily
> > > available.
> > >
> >
> > I don't get this logic at all.
> >
> > What's the actual point of sanselan? You implement TIFF reading etc. Is it
> _only_ types of TIFFs that ImageIO don't read, then? (The JAI stuff is
> really just extra plugins to that now)
> >
> > Having a new, different implementation would be great. Preferably one that
> emphasized the entire "file to BufferedImage" and "BufferedImage to file"
> processes, not as with the "magic" in ImageIO, where you have too little
> understanding of how one end up with the final pixels, or the final bytes.
> All steps should be (able to be) explicit. (Read that as "magic ColorProfile
> apply is bad").
> >
> > JAI does have a real Java implementation of pretty much all of the JPEG
> standards. One more such implementation developed under a really free
> license (Apache) would be great - the same reason for having Harmony, I
> guess?
> >
> > I understand the work-amount argument. I believe I will never understand
> any other argument in this regard.
> >
> > Endre.
> >
> >
>
>
> --
>
> Carsten Ziegeler
> cziegeler@apache.org
>
Re: JPEG Support
Posted by Carsten Ziegeler <cz...@apache.org>.
Ok, thanks for all the answer! So it seems that we *could* do it, but
its a lot of work. I would really love to have full jpeg support in
sanselan - atm I don't care about performance.
Would it be possible to use any existing stuff?
Carsten
Endre Stølsvik wrote:
> Charles Matthew Chen wrote:
>> Hi,
>>
>> My personal feeling about implementing JPEG:
>>
>> * not sure if there is a patent issue.
>
> There aren't any (anymore). Trust me: It'd be heard about by now.
>
>> * a pure-java implementation will always be slower than a native
>> (c/c++) implementation.
>
> Of course. And much better than a JNI solution, with its inherit dangers
> and noncompatiblity.
>
>>
>> There might be virtue in adding pure-Java jpeg decode/encode
>> support to Sanselan, but the case is hard to make. People use JPEG in
>> a different way than other formats. They use it for large collections
>> of large images. Performance matters. Users are going to turn to a
>> native implementation. Why rewrite the excellent and mature libjpeg?
>>
>> Its hard to imagine us even doing better (in terms of stability,
>> maturity and performance) than ImageIO or JAI, which are readily
>> available.
>
> I don't get this logic at all.
>
> What's the actual point of sanselan? You implement TIFF reading etc. Is
> it _only_ types of TIFFs that ImageIO don't read, then? (The JAI stuff
> is really just extra plugins to that now)
>
> Having a new, different implementation would be great. Preferably one
> that emphasized the entire "file to BufferedImage" and "BufferedImage to
> file" processes, not as with the "magic" in ImageIO, where you have too
> little understanding of how one end up with the final pixels, or the
> final bytes. All steps should be (able to be) explicit. (Read that as
> "magic ColorProfile apply is bad").
>
> JAI does have a real Java implementation of pretty much all of the JPEG
> standards. One more such implementation developed under a really free
> license (Apache) would be great - the same reason for having Harmony, I
> guess?
>
> I understand the work-amount argument. I believe I will never understand
> any other argument in this regard.
>
> Endre.
>
--
Carsten Ziegeler
cziegeler@apache.org
Re: JPEG Support
Posted by Endre Stølsvik <On...@stolsvik.com>.
Charles Matthew Chen wrote:
> Hi,
>
> My personal feeling about implementing JPEG:
>
> * not sure if there is a patent issue.
There aren't any (anymore). Trust me: It'd be heard about by now.
> * a pure-java implementation will always be slower than a native
> (c/c++) implementation.
Of course. And much better than a JNI solution, with its inherit dangers
and noncompatiblity.
>
> There might be virtue in adding pure-Java jpeg decode/encode
> support to Sanselan, but the case is hard to make. People use JPEG in
> a different way than other formats. They use it for large collections
> of large images. Performance matters. Users are going to turn to a
> native implementation. Why rewrite the excellent and mature libjpeg?
>
> Its hard to imagine us even doing better (in terms of stability,
> maturity and performance) than ImageIO or JAI, which are readily
> available.
I don't get this logic at all.
What's the actual point of sanselan? You implement TIFF reading etc. Is
it _only_ types of TIFFs that ImageIO don't read, then? (The JAI stuff
is really just extra plugins to that now)
Having a new, different implementation would be great. Preferably one
that emphasized the entire "file to BufferedImage" and "BufferedImage to
file" processes, not as with the "magic" in ImageIO, where you have too
little understanding of how one end up with the final pixels, or the
final bytes. All steps should be (able to be) explicit. (Read that as
"magic ColorProfile apply is bad").
JAI does have a real Java implementation of pretty much all of the JPEG
standards. One more such implementation developed under a really free
license (Apache) would be great - the same reason for having Harmony, I
guess?
I understand the work-amount argument. I believe I will never understand
any other argument in this regard.
Endre.
Re: JPEG Support
Posted by Charles Matthew Chen <ch...@gmail.com>.
Hi,
My personal feeling about implementing JPEG:
* not sure if there is a patent issue.
* definitely "quite a bit of work."
* a pure-java implementation will always be slower than a native
(c/c++) implementation.
There might be virtue in adding pure-Java jpeg decode/encode
support to Sanselan, but the case is hard to make. People use JPEG in
a different way than other formats. They use it for large collections
of large images. Performance matters. Users are going to turn to a
native implementation. Why rewrite the excellent and mature libjpeg?
Its hard to imagine us even doing better (in terms of stability,
maturity and performance) than ImageIO or JAI, which are readily
available.
Charles
On Tue, Apr 8, 2008 at 11:26 PM, Jeremias Maerki <de...@jeremias-maerki.ch> wrote:
> I think there are no severe problems that should keep the ASF from
> producing a full implementation. There is some interesting information
> on Wikipedia:
> http://en.wikipedia.org/wiki/JPEG#Potential_patent_issues
>
> In terms of full support, the rest of the above Wiki page should give an
> idea what kinds of steps are involved in encoding and decoding a JPEG
> image. Obviously, this thing has to be as fast as possible. Harmony used
> libjpeg (in C) for the JPEG codec:
> http://svn.apache.org/repos/asf/harmony/enhanced/classlib/trunk/modules/imageio/src/main/native/jpegencoder
> Of course, we could do it the same way, but a plain Java implementation
> would really be great because there are no problems with different
> platforms even if that means a possible, little performance impact. At
> any rate, I guess it's quite a bit of work. Anyway, the decoder is
> probably more important than the encoder. Well, at least to me. ;-)
>
>
>
> On 08.04.2008 11:35:07 Carsten Ziegeler wrote:
> > Just curious, what needs to be done to get full jpeg support? Are there
> > any legal problems?
> >
> > Carsten
> > --
> > Carsten Ziegeler
> > cziegeler@apache.org
>
>
>
> Jeremias Maerki
>
>
Re: JPEG Support
Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
I think there are no severe problems that should keep the ASF from
producing a full implementation. There is some interesting information
on Wikipedia:
http://en.wikipedia.org/wiki/JPEG#Potential_patent_issues
In terms of full support, the rest of the above Wiki page should give an
idea what kinds of steps are involved in encoding and decoding a JPEG
image. Obviously, this thing has to be as fast as possible. Harmony used
libjpeg (in C) for the JPEG codec:
http://svn.apache.org/repos/asf/harmony/enhanced/classlib/trunk/modules/imageio/src/main/native/jpegencoder
Of course, we could do it the same way, but a plain Java implementation
would really be great because there are no problems with different
platforms even if that means a possible, little performance impact. At
any rate, I guess it's quite a bit of work. Anyway, the decoder is
probably more important than the encoder. Well, at least to me. ;-)
On 08.04.2008 11:35:07 Carsten Ziegeler wrote:
> Just curious, what needs to be done to get full jpeg support? Are there
> any legal problems?
>
> Carsten
> --
> Carsten Ziegeler
> cziegeler@apache.org
Jeremias Maerki