Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Image quality reduction

Posted on 1997-03-13
2
Medium Priority
?
224 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 100 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
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…
Suggested Courses

670 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