EmbeddedRelated.com
Forums
Memfault State of IoT Report

LPC2478 - JPEG and/or PNG decoding

Started by thisaliasisinvalid April 13, 2011
Hello, I've got my custom made LPC2478 board with a 480*272 pixels lcd
TFT and 8MByte SDRAM up and running. Right now I can display 24bpp
'.bmp' pictures just fine but I'd like to be able to display '.jpg'
and/or '.png' files with 24 and/or 32bpp. Is it feasible to decode JPEG
in this uC?Do any of you owners of the EA and Olimex boards with the
LPC2478 have any experience with JPEG and PNG decoding? Are there EA or
Olimex examples that display a JPEG image?What about source code? I can
find the ijg source for the JPEG decoder but it seems way to
complicated.I'll try to port a PNG decoder to ARM
(http://homepage3.nifty.com/ysflight/pngdecoder/pngdecodere.html
) but
I'd be very happy if any of you could save me from that trouble.
Any help would be appreciated.
Kind Regards,Bernardo Marques.

An Engineer's Guide to the LPC2100 Series

This may be of help: http://www.boutell.com/gd/

On Wed, Apr 13, 2011 at 10:17 AM, thisaliasisinvalid <
b...@gmail.com> wrote:

> Hello,
> I've got my custom made LPC2478 board with a 480*272 pixels lcd TFT and
> 8MByte SDRAM up and running.
> Right now I can display 24bpp '.bmp' pictures just fine but I'd like to be
> able to display '.jpg' and/or '.png' files with 24 and/or 32bpp. Is it
> feasible to decode JPEG in this uC?
> Do any of you owners of the EA and Olimex boards with the LPC2478 have any
> experience with JPEG and PNG decoding? Are there EA or Olimex examples that
> display a JPEG image?
> What about source code? I can find the ijg source for the JPEG decoder but
> it seems way to complicated.
> I'll try to port a PNG decoder to ARM (
> http://homepage3.nifty.com/ysflight/pngdecoder/pngdecodere.html ) but I'd
> be very happy if any of you could save me from that trouble.
>
> Any help would be appreciated.
>
> Kind Regards,
> Bernardo Marques.
>
>
>
I think that decoding is going to be a lot of work. The reason the code you found seems complicated is because, well, it is! Check the Wikipedia entry for the file format.

Why not just use a Paint type program to change the JPGs to BMPs and be done with it. Sure, they may take more storage but that might not be a limiting factor.

I'm not sure how much compression you might get if you used .zip to store the images. This may not be worth the effort either!

Richard
--- In l..., David Smead wrote:
>
> This may be of help: http://www.boutell.com/gd/
>
> On Wed, Apr 13, 2011 at 10:17 AM, thisaliasisinvalid <
> bernardo.marques@...> wrote:
>
> >
> >
> > Hello,
> > I've got my custom made LPC2478 board with a 480*272 pixels lcd TFT and
> > 8MByte SDRAM up and running.
> > Right now I can display 24bpp '.bmp' pictures just fine but I'd like to be
> > able to display '.jpg' and/or '.png' files with 24 and/or 32bpp. Is it
> > feasible to decode JPEG in this uC?
> > Do any of you owners of the EA and Olimex boards with the LPC2478 have any
> > experience with JPEG and PNG decoding? Are there EA or Olimex examples that
> > display a JPEG image?
> > What about source code? I can find the ijg source for the JPEG decoder but
> > it seems way to complicated.
> > I'll try to port a PNG decoder to ARM (
> > http://homepage3.nifty.com/ysflight/pngdecoder/pngdecodere.html ) but I'd
> > be very happy if any of you could save me from that trouble.
> >
> > Any help would be appreciated.
> >
> > Kind Regards,
> > Bernardo Marques.
> >
> >
>

*BMP images uses a lot of memory, I couldn't avoid using it as well. At
least flash has a lot of KB....*
*
*
***Att.
*

2011/4/13 rtstofer

> I think that decoding is going to be a lot of work. The reason the code you
> found seems complicated is because, well, it is! Check the Wikipedia entry
> for the file format.
>
> Why not just use a Paint type program to change the JPGs to BMPs and be
> done with it. Sure, they may take more storage but that might not be a
> limiting factor.
>
> I'm not sure how much compression you might get if you used .zip to store
> the images. This may not be worth the effort either!
>
> Richard
> --- In l..., David Smead wrote:
> >
> > This may be of help: http://www.boutell.com/gd/
> >
> > On Wed, Apr 13, 2011 at 10:17 AM, thisaliasisinvalid <
> > bernardo.marques@...> wrote:
> >
> > >
> > >
> > > Hello,
> > > I've got my custom made LPC2478 board with a 480*272 pixels lcd TFT and
> > > 8MByte SDRAM up and running.
> > > Right now I can display 24bpp '.bmp' pictures just fine but I'd like to
> be
> > > able to display '.jpg' and/or '.png' files with 24 and/or 32bpp. Is it
> > > feasible to decode JPEG in this uC?
> > > Do any of you owners of the EA and Olimex boards with the LPC2478 have
> any
> > > experience with JPEG and PNG decoding? Are there EA or Olimex examples
> that
> > > display a JPEG image?
> > > What about source code? I can find the ijg source for the JPEG decoder
> but
> > > it seems way to complicated.
> > > I'll try to port a PNG decoder to ARM (
> > > http://homepage3.nifty.com/ysflight/pngdecoder/pngdecodere.html ) but
> I'd
> > > be very happy if any of you could save me from that trouble.
> > >
> > > Any help would be appreciated.
> > >
> > > Kind Regards,
> > > Bernardo Marques.
> > >
> > >
> > >
> >
>
Hello,

Felipe:
I store my images a 8GB uSD card so space is not an issue. I just thought
that maybe, and just maybe, decoding a JPEG or a PNG would be faster than
reading some 300 and something Kb (the difference in file sizes) from the SD
card. I'm reading at 7MByte/s rate but one 480*272*24bpp image bmp is almost
500Kbytes and that means that at best, if I have no processing to do on the
image (I'll need to compose images from two or more source images that are
several layers, like a background image and a foreground image with some
tranparency) It will take me almost 100ms only to read the file, since I'll
have to read the image and copy it I'll never be able to get more than
10fps. I'd really like to be able to show one or two second animations from
a set of still images, since video decoding is most certainly impossible.

Richard:
I have seen the file format, and the PNG specification they are complex
indeed, that's why I was hoping that with so many LPC2478 Olimex and EA
boards out there someone would have had the trouble to write the code. What
do people do with those boards and their fancy displays if they can read no
images?
Using Paint or GIMP to convert images to BMP is what I'm doing now. I know I
can have my board to only read BMP files but I'd really like to be able to
read other formats.
Zipping is not a solution that I'll look at, that would be a bigger
problem... I'd have to write code to unzip files... how much simpler than
decoding a JPEG would that be? And I'd like to read JPEG and PNG to ease the
use, I'd would make it harder to use if I had to convert to BMP then ZIP...
nah.

David:
Nah... the software in that link doesn't seem to do the encoding/decoding
part, they rely on the ijg library for JPEG and some other for PNG.
Regards and thanks for all the replies,
Bernardo Marques.
On Thu, Apr 14, 2011 at 3:03 AM, Felipe de Andrade Neves L. <
f...@gmail.com> wrote:

> *BMP images uses a lot of memory, I couldn't avoid using it as well. At
> least flash has a lot of KB....*
> *
> *
> ***Att.
> *
>
> 2011/4/13 rtstofer > I think that decoding is going to be a lot of work. The reason the code
>> you found seems complicated is because, well, it is! Check the Wikipedia
>> entry for the file format.
>>
>> Why not just use a Paint type program to change the JPGs to BMPs and be
>> done with it. Sure, they may take more storage but that might not be a
>> limiting factor.
>>
>> I'm not sure how much compression you might get if you used .zip to store
>> the images. This may not be worth the effort either!
>>
>> Richard
>> --- In l..., David Smead wrote:
>> >
>> > This may be of help: http://www.boutell.com/gd/
>> >
>> > On Wed, Apr 13, 2011 at 10:17 AM, thisaliasisinvalid <
>> > bernardo.marques@...> wrote:
>> >
>> > >
>> > >
>> > > Hello,
>> > > I've got my custom made LPC2478 board with a 480*272 pixels lcd TFT
>> and
>> > > 8MByte SDRAM up and running.
>> > > Right now I can display 24bpp '.bmp' pictures just fine but I'd like
>> to be
>> > > able to display '.jpg' and/or '.png' files with 24 and/or 32bpp. Is it
>> > > feasible to decode JPEG in this uC?
>> > > Do any of you owners of the EA and Olimex boards with the LPC2478 have
>> any
>> > > experience with JPEG and PNG decoding? Are there EA or Olimex examples
>> that
>> > > display a JPEG image?
>> > > What about source code? I can find the ijg source for the JPEG decoder
>> but
>> > > it seems way to complicated.
>> > > I'll try to port a PNG decoder to ARM (
>> > > http://homepage3.nifty.com/ysflight/pngdecoder/pngdecodere.html ) but
>> I'd
>> > > be very happy if any of you could save me from that trouble.
>> > >
>> > > Any help would be appreciated.
>> > >
>> > > Kind Regards,
>> > > Bernardo Marques.
>> > >
>> > >
>> > >
>> >
>
>
Using RLE encoding works quite well for "graphics" type images, obviously it's useless on photos.
Paul.

> -----Original Message-----
> From: l... [mailto:l...] On
> Behalf Of rtstofer
> Sent: Thursday, 14 April 2011 8:43 AM
> To: l...
> Subject: [lpc2000] Re: LPC2478 - JPEG and/or PNG decoding
>
> I think that decoding is going to be a lot of work. The reason the code you
> found seems complicated is because, well, it is! Check the Wikipedia entry
> for the file format.
>
> Why not just use a Paint type program to change the JPGs to BMPs and be
> done with it. Sure, they may take more storage but that might not be a
> limiting factor.
>
> I'm not sure how much compression you might get if you used .zip to store
> the images. This may not be worth the effort either!
>
> Richard
Hi, Bernando,

We are using "middle" solution - pcx format. It reduces size on external memory (approx 3 times), converting is easy and fast.
Animation can be done by pages change. Time of animation depends from resolusion. Few seconds is possible.

By the way, we created even "something like GUI" basing on the PCX-files on SD-card.

Regards
Vladimir

----- Original Message -----
From: Bernardo
To: l...
Sent: Thursday, April 14, 2011 10:02 AM
Subject: Re: [lpc2000] Re: LPC2478 - JPEG and/or PNG decoding

Hello,
Felipe:
I store my images a 8GB uSD card so space is not an issue. I just thought that maybe, and just maybe, decoding a JPEG or a PNG would be faster than reading some 300 and something Kb (the difference in file sizes) from the SD card. I'm reading at 7MByte/s rate but one 480*272*24bpp image bmp is almost 500Kbytes and that means that at best, if I have no processing to do on the image (I'll need to compose images from two or more source images that are several layers, like a background image and a foreground image with some tranparency) It will take me almost 100ms only to read the file, since I'll have to read the image and copy it I'll never be able to get more than 10fps. I'd really like to be able to show one or two second animations from a set of still images, since video decoding is most certainly impossible.
Richard:
I have seen the file format, and the PNG specification they are complex indeed, that's why I was hoping that with so many LPC2478 Olimex and EA boards out there someone would have had the trouble to write the code. What do people do with those boards and their fancy displays if they can read no images?
Using Paint or GIMP to convert images to BMP is what I'm doing now. I know I can have my board to only read BMP files but I'd really like to be able to read other formats.
Zipping is not a solution that I'll look at, that would be a bigger problem... I'd have to write code to unzip files... how much simpler than decoding a JPEG would that be? And I'd like to read JPEG and PNG to ease the use, I'd would make it harder to use if I had to convert to BMP then ZIP... nah.
David:
Nah... the software in that link doesn't seem to do the encoding/decoding part, they rely on the ijg library for JPEG and some other for PNG.

Regards and thanks for all the replies,
Bernardo Marques.

On Thu, Apr 14, 2011 at 3:03 AM, Felipe de Andrade Neves L. wrote:

BMP images uses a lot of memory, I couldn't avoid using it as well. At least flash has a lot of KB....

Att.

2011/4/13 rtstofer

I think that decoding is going to be a lot of work. The reason the code you found seems complicated is because, well, it is! Check the Wikipedia entry for the file format.

Why not just use a Paint type program to change the JPGs to BMPs and be done with it. Sure, they may take more storage but that might not be a limiting factor.

I'm not sure how much compression you might get if you used .zip to store the images. This may not be worth the effort either!

Richard

--- In l..., David Smead wrote:
>
> This may be of help: http://www.boutell.com/gd/
>
> On Wed, Apr 13, 2011 at 10:17 AM, thisaliasisinvalid <

> bernardo.marques@...> wrote:
>
> >
> >
> > Hello,
> > I've got my custom made LPC2478 board with a 480*272 pixels lcd TFT and
> > 8MByte SDRAM up and running.
> > Right now I can display 24bpp '.bmp' pictures just fine but I'd like to be
> > able to display '.jpg' and/or '.png' files with 24 and/or 32bpp. Is it
> > feasible to decode JPEG in this uC?
> > Do any of you owners of the EA and Olimex boards with the LPC2478 have any
> > experience with JPEG and PNG decoding? Are there EA or Olimex examples that
> > display a JPEG image?
> > What about source code? I can find the ijg source for the JPEG decoder but
> > it seems way to complicated.
> > I'll try to port a PNG decoder to ARM (
> > http://homepage3.nifty.com/ysflight/pngdecoder/pngdecodere.html ) but I'd
> > be very happy if any of you could save me from that trouble.
> >
> > Any help would be appreciated.
> >
> > Kind Regards,
> > Bernardo Marques.
> >
> >
> >
>

Memfault State of IoT Report