Thread overview
Tiny Jpeg Decoder
Apr 04, 2007
Bill Baxter
Apr 04, 2007
Gregor Richards
Apr 04, 2007
Bill Baxter
Apr 04, 2007
orgoton
Apr 04, 2007
BCS
Apr 05, 2007
Bill Baxter
Apr 05, 2007
Lutger
April 03, 2007
Hi all,
I've ported a small Jpeg decoder from C to D and decided I'll let you all
know about it. I needed it for a small image loading library I've been
working on. This will probably be released at some point as well, but until
then here's the jpeg decoding part.

BCS has kindly allowed me to put it in scrapple, so getting a copy should be a familiar process to most D users. [1]

You can check out the scrapple site at: http://dsource.org/projects/scrapple I made a small wiki page with a usage example,

The original C source code can be found at: http://www.saillard.org/programs_and_patches/tinyjpegdecoder/

Hope it's useful for someone.

- Tomas Lindquist Olsen

[1]: http://dsource.org/projects/scrapple/browser/trunk/tinyjpeg

April 04, 2007
Tomas Lindquist Olsen wrote:
> Hi all,
> I've ported a small Jpeg decoder from C to D and decided I'll let you all
> know about it. I needed it for a small image loading library I've been
> working on. This will probably be released at some point as well, but until
> then here's the jpeg decoding part.
> 
> BCS has kindly allowed me to put it in scrapple, so getting a copy should be
> a familiar process to most D users. [1]
> 
> You can check out the scrapple site at: http://dsource.org/projects/scrapple
> I made a small wiki page with a usage example,
> 
> The original C source code can be found at:
> http://www.saillard.org/programs_and_patches/tinyjpegdecoder/
> 
> Hope it's useful for someone.
> 
> - Tomas Lindquist Olsen
> 
> [1]: http://dsource.org/projects/scrapple/browser/trunk/tinyjpeg
> 

Sweet.  Three files and minimal dependencies!  Know of any other tiny image format decoders?  Specifically a decoder-only "tinypng" would be nice to have.  Phobos has std.zip already so it should be possible to write a very tiny decoder.

I guess most BMP and TGA decoders are tiny to begin with.  GLD has a nice little TGA decoder that's 384 lines.

Might be nice to extract that into a little scrapple lib too.

--bb
April 04, 2007
Bill Baxter wrote:
> Tomas Lindquist Olsen wrote:
>> Hi all,
>> I've ported a small Jpeg decoder from C to D and decided I'll let you all
>> know about it. I needed it for a small image loading library I've been
>> working on. This will probably be released at some point as well, but until
>> then here's the jpeg decoding part.
>>
>> BCS has kindly allowed me to put it in scrapple, so getting a copy should be
>> a familiar process to most D users. [1]
>>
>> You can check out the scrapple site at: http://dsource.org/projects/scrapple
>> I made a small wiki page with a usage example,
>>
>> The original C source code can be found at:
>> http://www.saillard.org/programs_and_patches/tinyjpegdecoder/
>>
>> Hope it's useful for someone.
>>
>> - Tomas Lindquist Olsen
>>
>> [1]: http://dsource.org/projects/scrapple/browser/trunk/tinyjpeg
>>
> 
> Sweet.  Three files and minimal dependencies!  Know of any other tiny image format decoders?  Specifically a decoder-only "tinypng" would be nice to have.  Phobos has std.zip already so it should be possible to write a very tiny decoder.
> 
> I guess most BMP and TGA decoders are tiny to begin with.  GLD has a nice little TGA decoder that's 384 lines.
> 
> Might be nice to extract that into a little scrapple lib too.
> 
> --bb

Search the newsgroups, somebody posted a port of lodepng.

 - Gregor Richards
April 04, 2007
Gregor Richards wrote:

>> Sweet.  Three files and minimal dependencies!  Know of any other tiny image format decoders?  Specifically a decoder-only "tinypng" would be nice to have.  Phobos has std.zip already so it should be possible to write a very tiny decoder.
>>
>> I guess most BMP and TGA decoders are tiny to begin with.  GLD has a nice little TGA decoder that's 384 lines.
>>
>> Might be nice to extract that into a little scrapple lib too.
>>
>> --bb
> 
> Search the newsgroups, somebody posted a port of lodepng.
> 
>  - Gregor Richards

Thanks.   It was Lutger.
http://www.digitalmars.com/d/archives/digitalmars/D/announce/png_decoder_6677.html
Here's the link:
  lutger.ifastnet.com/png.d

--bb
April 04, 2007
I have coded a TGA decoder that loads compressed and uncompressed TGA files. 24 or 32 bit. It's super-tiny (~100 lines of code). If you could use it in your _open sourced_ project, I'd be glad to contribute.
April 04, 2007
orgoton wrote:
> I have coded a TGA decoder that loads compressed and uncompressed TGA files. 24 or 32 bit. It's super-tiny (~100 lines of code). If you could use it in your _open sourced_ project, I'd be glad to contribute.

If you want, I can let you put it up on scapple well.
April 05, 2007
orgoton wrote:
> I have coded a TGA decoder that loads compressed and uncompressed TGA files. 24 or 32 bit. It's super-tiny (~100 lines of code). If you could use it in your _open sourced_ project, I'd be glad to contribute.

Hmm.  I think the one in GLD handles 8-bit TGA gray maps too.  Maybe gray+alpha also... hard to tell.
And I don't think it's encumbered by any "open source only" license (GLFW, where it was ported from is Zlib).

So... I should get off my duff and make a stand-alone port of it for scrapple.

Anyway, I really like the idea of assembling a tiny, dependency-free, bare-bones collection of image loaders.  Next step would be to give these PNG/JPEG/TGA loaders a consistent API for loading and such.

--bb
April 05, 2007
Tomas Lindquist Olsen wrote:
> Hi all,
> I've ported a small Jpeg decoder from C to D and decided I'll let you all
> know about it. I needed it for a small image loading library I've been
> working on. This will probably be released at some point as well, but until
> then here's the jpeg decoding part.
> 
> BCS has kindly allowed me to put it in scrapple, so getting a copy should be
> a familiar process to most D users. [1]
> 
> You can check out the scrapple site at: http://dsource.org/projects/scrapple
> I made a small wiki page with a usage example,
> 
> The original C source code can be found at:
> http://www.saillard.org/programs_and_patches/tinyjpegdecoder/
> 
> Hope it's useful for someone.
> 
> - Tomas Lindquist Olsen
> 
> [1]: http://dsource.org/projects/scrapple/browser/trunk/tinyjpeg
> 

Very nice thank you!