Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8089202

Image scaled down by more than 50% is not smooth

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P4
    • tbd
    • fx2.0
    • javafx
    • None
    • Mac OS X

    Description

      I have a company logo which is shown in several places in our app. In one place it is shown at approximately 30% size. Even though I have tried logo.setSmooth(true), the logo is shown with very jagged edges. I have experimented with image caching and a smooth caching hint as well.

      When scaling down the logo to 30% size in Photoshop i get a perfectly smooth logo, but when loading a smooth PNG from Java FX and showing it scaled, it is clearly jagged.

      The logo contains the letters "fe". I have attached images showing the original "fe" scaled down using a tool as well as the scaled result i get with Java FX.

      Note that the logo is exported as a PNG with a transparent background to ensure the logo will blend correctly on top of the different backgrounds of the app. This means the logo contains semitransparent pixels at the edges of each letter - could this be what confuses your scaling algorithm?

      The code I use to display the image is

      logoImage = Images.load("logo.png");
      logo = new ImageView(logoImage);
      logo.setX(2852);
      logo.setY(23);
      logo.setSmooth(true);
      logo.setCache(true);
      logo.setCacheHint(CacheHint.QUALITY);
      double logoScale = 0.29920051;
      logo.setScaleX(logoScale);
      logo.setScaleY(logoScale);
      getChildren().add(logo);

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              risaksen Randahl Isaksen
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Imported: