• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Why did it have to be PNG

 
Ranch Hand
Posts: 350
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I have been working on writing J2ME applications for the last few months or
more. I have written MIDLets that display certain images from the net on my
mobile phone. Since images have to displayed on the mobile phone I have to
convert the image into PNG format so that it can be displayed on the mobile
phone, I am not performing the image conversion on the mobile since there
are not ready made APIs to do the job, so the image conversion is done in a
intermediate server that sits between the mobile applicaion and the actual
application that provides the image.
Writing the program to convert a jpg or a gif image to a PNG image does not
prove to be a major problem, but it does include a performance hit, since
the midlet is no longer getting the image from the source web site it has
to tunner through my web site that converts the original jpg image into png
format ( is there a better or a faster method to do this ?) .
I was wondering as to why PNG was selected as format of the image that can
be displayed using J2ME, when most of the images on the net are jpg or gif
images. Image conversion is not the only problem when I convert the image
from JPEG to PNG, there is major increase in size ( tested for
16 bit 128x128 images) which reduces the network performance even more
( that is particulary a problem since mobile networks are slow unless you
are using GRPS which should be a bit faster but not that fast ).
So here is what my intermediate servlet does
1. Fetch the actualy image ( jpg/gif format)
2. Reduce the size (dimentions)of the image so that it can be displayed on
the mobile screen.
3. Reduce the color depth of the image to 4096 colors ( this is required
since my Nokia 7210 can display only 4096 colors so it does not make sense
sending truecolor images which are als larger in size )
4. Convert the image into PNG format so that it can be displayed on the
mobile phone using J2ME.
This image conversion really seems useless for my Nokia 7210 since it can
directly display jpg images, but not through j2me since j2me only allows
png images to be displayed. I dont think I can use the Nokia j2me API to
display jpg images ??? Can I ??? --- If that is possible please feel free
to fire me!!
So is there any particular reason to choose PNG over other popular internet
imaging format ???
And I dont think I ever heard of PNG before this.......
vivek
 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As I fas as I know using GIF is not allowed, you would need I license for that I think.
JPG isn't allowed because it uses a lot cpu-power. For decompressing it. At least that was what the i-mode guys used to tell me.
Why should we choose PNG? Because PNG(pronounced PING) is license free. Supports both colormapped and truecolor images (not just 24 bits, even 48 bits).
For the Web, PNG really has three main advantages over GIF: alpha channels (variable transparency), gamma correction (cross-platform control of image brightness), and two-dimensional interlacing (a method of progressive display).
For getting smaller images (png) you should try to optimize them.
Regards,
Mark Monster

Originally posted by Vivek Viswanathan:
Hi
I have been working on writing J2ME applications for the last few months or
more. I have written MIDLets that display certain images from the net on my
mobile phone. Since images have to displayed on the mobile phone I have to
convert the image into PNG format so that it can be displayed on the mobile
phone, I am not performing the image conversion on the mobile since there
are not ready made APIs to do the job, so the image conversion is done in a
intermediate server that sits between the mobile applicaion and the actual
application that provides the image.
Writing the program to convert a jpg or a gif image to a PNG image does not
prove to be a major problem, but it does include a performance hit, since
the midlet is no longer getting the image from the source web site it has
to tunner through my web site that converts the original jpg image into png
format ( is there a better or a faster method to do this ?) .
I was wondering as to why PNG was selected as format of the image that can
be displayed using J2ME, when most of the images on the net are jpg or gif
images. Image conversion is not the only problem when I convert the image
from JPEG to PNG, there is major increase in size ( tested for
16 bit 128x128 images) which reduces the network performance even more
( that is particulary a problem since mobile networks are slow unless you
are using GRPS which should be a bit faster but not that fast ).
So here is what my intermediate servlet does
1. Fetch the actualy image ( jpg/gif format)
2. Reduce the size (dimentions)of the image so that it can be displayed on
the mobile screen.
3. Reduce the color depth of the image to 4096 colors ( this is required
since my Nokia 7210 can display only 4096 colors so it does not make sense
sending truecolor images which are als larger in size )
4. Convert the image into PNG format so that it can be displayed on the
mobile phone using J2ME.
This image conversion really seems useless for my Nokia 7210 since it can
directly display jpg images, but not through j2me since j2me only allows
png images to be displayed. I dont think I can use the Nokia j2me API to
display jpg images ??? Can I ??? --- If that is possible please feel free
to fire me!!
So is there any particular reason to choose PNG over other popular internet
imaging format ???
And I dont think I ever heard of PNG before this.......
vivek

 
Ranch Hand
Posts: 2676
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
M.K.A. is correct that a license is needed for gif.
 
Vivek Viswanathan
Ranch Hand
Posts: 350
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot for that information.
A few more questions 'i-mode' ..who r they ?
Does MIDP1.0 ( which most phones have ) support alpha channels (variable transparency), gamma correction (cross-platform control of image brightness), and two-dimensional interlacing (a method of progressive display)???
How should I optimize the image ?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic