Solved

Image quality reduction

Posted on 1997-03-13
2
216 Views
Last Modified: 2012-06-27
I have emade a couple of applets showing a slideshow with images.
When the images (gif or jpg) appear in the applet, the quality is
reduced from the original image. It seem like they show up in 16 colors
or non-dithered or something.
I have tried different images, but the problem appear each time.
Doesnt java support a 256 color dithered gif ??

0
Comment
Question by:apriks
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Accepted Solution

by:
amarshal earned 50 total points
ID: 1219004
When a true color (16-Million) display is not available, the majority of Java platforms convert the image into Web colors, a 256-color pallete agreed upon by all browsers.

The best answer I have to fix this problem is to convert the images to Web colors, as a gif, before you upload them.  Photoshop does an excellent job of converting the images, and 4.0 has an option under mode-indexed color to choose web colors directly.  It will look a little bit dithered by being in 256 color mode, but Photoshop's algorithm is much better.
0
 
LVL 2

Expert Comment

by:mgk
ID: 1219005
You can fix the dithering problem with Netscape by creating the image again from a memory source.

Check out http://www.powerup.com.au/~mgk/java/banner.html, if you view source you will see that most of the banners are full colour GIFs. In this case I ran it all through a Filter that did nothing to the image data, but you could also convert all the data into an array and then create an image with it. Images created from memory don't dither. Here's the code:

Image tempimage=getImage(getCodeBase(),getParameter("banner"+i));
ImageFilter f=new FixDither();
ImageProducer producer=new FilteredImageSource(tempimage.getSource(),f);
image=this.createImage(producer);


class FixDither extends RGBImageFilter {
  public void FixDither() {
    canFilterIndexColorModel = true;
  }
      
  public int filterRGB(int x, int y, int rgb) {
    return rgb;
  }
}
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn different types of Android Layout and some basics of an Android App.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question