JavaFX 8: how to make better anti-aliasing?

Is it possible to determine the best antialiasing with JavaFX 8? I'm creating an application that requires controls rotation and they look pretty bad, you can see a serrated line even with smooth turned on. I also tried to adjust the default value of DISABLED SceneAntialiasing to BALANCED, but I guess it's just for 3D scenes and nothing helped. All recommendations on how I can improve this?

Thank you.

javafx_lion.png

JavaFX

Toolkit = QuantumToolkit

Pipeline = D3DPipeline

Hardware acceleration ENABLED

Java

1.8.0 - B132, Oracle Corporation

Operating system

Windows 8, x 86, 6.2

The smooth property is any hint how JavaFX should apply to a filtering algorithm internal to generate the imageview pixels when you have values of fitToWidth/fitToHeight for your ImageView. that is, it is unrelated to anti-aliasing.

JavaFX does not provide parameters to configure anti-aliasing on a per node basis, on a basis of scene/subpicture.

By default when you create a scene, JavaFX sets anti-aliasing to false for the scene.

If you specify aliasing as SceneAntialiasing.BALANCED (rather than the default SceneAntialiasing.BALANCED), then your image in rotation will have images smooth (at least it worked for me on a Macbook Air + Java8u20 2012).

Here is a small test program that you can try.

import javafx.application.Application;
import javafx.scene.*;
import javafx.scene.image.*;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.stage.Stage;

public class McJagger extends Application {
    private final double W = 600, H = 450;
    private final double M = 50;
    private final double R = -8;

    @Override
    public void start(Stage stage) {
        Rectangle rectangle = new Rectangle(W, H);
        rectangle.setStroke(Color.GREEN);

        ImageView imageView = new ImageView(
            new Image(
                "http://images.nationalgeographic.com/wpf/media-live/photos/000/108/cache/african-lions-nuzzling_10887_600x450.jpg"
            )
        );
        Node node = imageView;
//        Node node = rectangle;

        node.relocate(M - 0.5, M - 0.5);
        node.setRotate(R);

        Group root = new Group(node);
//        Scene scene = new Scene(root, W + M*2, H + M*2, false, SceneAntialiasing.BALANCED);
        Scene scene = new Scene(root, W + M*2, H + M*2);
        System.out.println(scene.getAntiAliasing());
        stage.setScene(scene);
        stage.show();
    }
    public static void main(String[] args) {
        launch(args);
    }
}

Note that the process of inserting image on these forums is a little frozen, while the pictures shown here reflect exactly the quality of rendering you get when you run the program.

Aliasing of default scene:

Aliasing balanced scene:

You can also cross the message to the mailing list of the JavaFX developers where developers have some thoughts on this unit or how to improve the default aliasing on the images shot.

Openjfx-dev Info page

Tags: Java

Similar Questions

  • How to make an anti-aliasing not vector rectangles in Photoshop CS5 using a Wacom Intuos 4?

    Hello

    If you use Photoshop CS5 to draw a vector using the Wacom Intuos 4 rectangle, the rectangle out of anti-aliasing, but when I draw a rectangle by using a mouse on the same computer, there is no anti-aliasing.

    What can I do to get the vector of smoothing sharp, not rectangles?

    Any help would be appreciated.

    Thank you

    The choice of the mouse or stylus is not serious.  Form of layers in Photoshop are embattled, but you can reduce that by creating exactly on the pixel grid (look at the tool options and set it to hang on to the Pixels.

  • How to set the Anti Aliasing in Blackberry Storm?

    I m drawing in a bitmap as...

    bitmap[i] = new Bitmap(60, 60);
    Graphics g = new Graphics(bitmap[i]);
    g.setColor(Color.BLACK);
    g.drawLine(....);
    

    Now how to put Anti-Aliasing on before g.drawLine ()?

    Try again with the addition of this before drawline:

    g.setDrawingStyle(Graphics.DRAWSTYLE_AALINES, true);
    

    Concerning

    Bika

  • How to turn off anti-aliasing in adobe illustrator cc 19.10

    Hello.

    A few weeks ago I set up somehow Illustrator to preview rasterized without anti-aliasing. But today illustrator told me "sorry, but your configuration is corrupted and I have reset to the default values. And I spent a few hours trying to disable anti-aliasing!

    I have foud how to disable it for the text. But I need to disable it for ALL the objects in my document. How can I Maje it. Help, please. "Where is this option" disable anti-aliasing everywhere "?

    Thank you very much!

    Philipp.

    Preferences > General. The options in the left column.

  • Adobe Photoshop 10 How do disable you anti Aliasing?

    I use adobe photoshop 10 and I need to turn off anti aliasing, how?

    With most of the selection tools you can uncheck anti-aliasing in the toolbar options before drawing a selection.

  • Better anti-aliasing in Illustrator CS4?

    Is it possible to get the best anti-aliasing for Illustrator CS4? I'm working on style cartoon designs that will be used on the web and Illustrator seems to have a problem really bad folding. Is there a way to change this? I already have "smoothing work" checked in the preferences and the effects of rasterization of the document, but curved lines are still fairly jagged looking. Things will look smooth when they are printed, but given that I will use this on the web they are always looking in staircase. Illustrator of can not regular curves? Is it possible to make lines appear smoother?

    See this example:

    http://www.ghost9.com/aliasedLines.jpg

    No doubt about this and there should be no reason if we do

    manually, why the can not do something similar and make autmatic.

  • How to make better use of the CSS box model when setting margin/padding?

    I encounter this problem twice so far. When you set the vertical placement of a block of text, I had to set a margin or a padding that is clearly going to the top of the page, rather than referenceing the last element that precedes the text block. It seems totally wrong to me. I'm missing a fundamental step. Here's an example where I had to do this...

    http://www.keithpurtell.com/kthings/

    and how does it appear in Firebug...

    http://www.keithpurtell.com/kthings/BM.PNG

    When you "float" an item/s such as your

  • tags in the css ul #navlistx selector, they are deleted from the flow natural html (become invisible to any item/s that follow, as your #articlex
    .

    You need to "erase" these floating elements, so the natural flow of the html is corrected. There are many ways to 'clear' the elements' but the newer method uses overflow: hidden; When you have a container containing the items floating/s and you make, it's the #navigatex

    So you just need to add overflow: hidden; to the css (as shown below)

    #navigatex {margin: 2.6em automatic 2em; / * 3.3 * /}
    Width: 605px;
    overflow: hidden ;}

    You can now set your top margin on the css of #articlex to 1em (as shown below)

    {#articlex}
    margin: 1em Auto 2.375em;
    Width: 608px ;}

  • Windows 8 and anti-aliasing of fonts

    Hello!

    This is my first post in the Microsoft community.
    I'm a big fan of this company, and that I usually use their products in my studies, work, mail... etc.
    I've used Windows since XP, and I'm very happy with the last windows8.
    Windows 8 is much more fluid and more "BOLD", I love it!
    There's only one small problem, but it's really important me: font smoothing.
    I started using Ubuntu lately in my brother's laptop, and I was completely impressed by the display of fonts on it.
    It seems bigger, more professional and more :-)
    The police is 'acceptable' on windows only when it is greater than 50px.
    I see an evolution on this way on IE for ie9, but it certainly not the same as Ubuntu
    Can they take this thinking in mind when working with blue windows, or they will ignore it and continue with the fonts as 15years ago...

    Hello!

    I would like to offer a way to adjust your font smoothing.  To account for many types of LCD monitors and different types of pixels, Windows has adjustments to the police of smoothing method it uses.  It is possible that an optimal method of inferiority is currently used.  Here is how to adjust it:
    1. Open your startup screen and type the word "clear" (search results appear when you start typing).
    2. Select the category of settings on the right, then click on the result of research called "adjust ClearType text' to start the ClearType text.
    3. Click next in the wizard and then step through the calibration.  At each stage, you will be asked to click on the text that is best for you.  This will allow Windows to use better anti-aliasing of fonts for your system and your preference.
  • Text Anti-Aliasing at the Application level

    Does anyone know how to control the anti-aliasing of text to the application level? I don't want to go through each component and override the method object to set indicators to report on each of them. Anyone know of a more elegant way to do this in the code?

    Thank you.

    831503 wrote:
    Thank you, Andrew Thompson

    You and Kleopatra (Pharaoh of the Swing) are welcome. Happy, that I could help him. :-)

  • How to remove anti-aliasing of vector images?

    Hello. Currently, I'm editing of bitmap images that are embattled, and I did a lot of vector shape layers.

    And what I want to do is delete the antialiasing of all vector layers because if they are embattled, they may not fit into images above non-crenelees bitmap.

    I found an option to display images vector aliasing, I mean "Layer image quality" option in the control panel time line and I put "draft", but if I turn my sequence, AE allow me to make the project, the vector image of aliasing. They are castellated. AE ignores the project setting and makes the layers as best qualities, crenellated vector images.

    So I want to ask how do I completely remove the anti-aliasing of vector image.

    Please help me. Thank you.

    AE ignores the project setting and makes the layers as best qualities, crenellated vector images.

    It does that, because you are using bad rendering parameters. Check the detailed options for the layer switches in the control panel of render settings and use the "settings" rather than the best quality.

    Mylenium

  • How to disable anti-aliasing when resizing?

    Photoshop CS4 11.0.1

    I have a few images that have hard edges that I need to resize. When I do, the contours become anti-aliasing. How can I stop that from happening? I can't find any option for this.

    I have attached two files. The, fr1105Piece100.jpg first, a hard edges on the left and the right. The second, Fr1105Piece77.jpg, has smooth edges after I resize (CTRL-ALT-I) on the left and the right. I had to convert the images to jpg to download

    The reasons I do it is that I will take this unique image and make a picture of long px 4000. I'll take the image, copy it into a new image of long px 4000. Can I reverse horizontally the original image and copy it again into the new image. I need the edges to match. This process of reverse/copy/copy will continue until I get the long image of 400 px.  The anti-aliasing edges mean that I have to crop the image before copying and I don't want to do that.

    Use the command to resize the image, set the mode on "nearest neighbor" resampling

  • How to make a label (javafx) to display the current time dynamically?

    Hi all

    How to make a label (javafx) to display the current time dynamically?

    I have not found a Type of event related to the time in javafx API.

    Please give me some suggestions. Thank you!

    Sage

    There are lots of examples of JavaFX clocks available, for example https://gist.github.com/jewelsea/3388637 or http://blog.crisp.se/2012/08/09/perlundholm/an-analog-clock-in-javafx

    For a simple label displaying the time, the simplest thing is to create a Timeline with duration 1 second and the number of indefinite cycle, which triggers an event handler that updates the label:

    final Label clock = new Label();
    final DateFormat format = DateFormat.getInstance();
    final Timeline timeline = new Timeline(new KeyFrame(Duration.seconds(1), new EventHandler() {
         @Override
         public void handle(ActionEvent event) {
              final Calendar cal = Calendar.getInstance();
              clock.setText(format.format(cal.getTime());
         }
    });
    timeline.setCycleCount(Animation.INDEFINITE);
    timeline.play();
    

    (If you use Java 8, use the new time API, which is much more pleasant than calendar.)

  • How to disable anti-aliasing when layer resizing

    [PhotoShop Elements for Mac Version 6.0]

    Hello

    I want to resize a layer for example the orange ball:

    Screen shot 2012-08-22 at 09.48.38.png

    But if I resize the layer of the ball and confirm the resizing automatically apply a smoothing that is not desired in my case:

    Screen shot 2012-08-22 at 09.48.59.png

    How can I stop this?

    Thank you very much!

    Also if you have other layers that you want to resize, you can go ahead and free transform allows you to resize your object.

    Then go to filter > Pixelize > facet to remove the anti-aliasing. You may need to run the filter facet several times to completely eliminate anti-aliasing.

  • How can I turn off anti-aliasing on a per form basis in Adobe Illustrator?

    I was wondering if there is a way for example to uncheck a setting so that I can disable anti-aliasing for certain forms and let the anti-aliasing of other forms?

    Pixelation effect, e. g.

  • How to draw a line without anti-aliasing?

    I need to create lines for the selected underline buttons in a video menu. If I create a straight line with the line drawing tool line is anti-aliased. According to the position, it has more or less anti-aliasing and as yet will not display the colo complete them lines have different thickness or length. Is it possible turn of anti-aliasing for the daw line tool? I saw no option.

    As a solution, I found only the possibility to use the selection tool and then fill it out. The resulting sharp edges.

    Marcus

    Shape layers are always smoothed, but the nature of the beast, if the shape is not exactly on the limits of the pixels.

    The question is not to disable anti-aliasing, which is impossible for a shape layer - the trick is to get the shape traced on the limits of the pixels.

    Unfortunately there is no option to draw lines on the limits of pixels, but because of some options new added by the Adobe creative team you CAN draw rectangles on the limits of the pixels by selecting the rectangle tool and choosing this option:

    -Christmas

Maybe you are looking for

  • iCloud and ipad mini

    I recently downloaded two files to film my icloud account directly to my ipad mini. Where are these files on my device now? How can I access them to play?

  • AutoComplete suggests my user ID and date of birth on the log in page of my savings account - how can I stop this?

    Most of the time the AutoComplete is really useful. However, when I connect my savings account, my user ID and date of birth are available, allowing anyone on my PC to check my account (a security code is required for all transactions which does not

  • Bowers & Wilkins T7 Bluetooth speaker connected, no sound

    Connects to the speaker, but will not make a sound. It isn't muted in the sound preferences and it won't work for any sound, not iTunes, amazon etc... I have sound from all of these places if I disconnect and use the laptop speakers. Can I use the sp

  • Disable the peripheral only USB storage drive?

    How can I disable only USB key in windows XP Professional without disable keyboard and mouse because these are fixed with USB ports.Operating system: Windows XP Profesional

  • Help XP Professional 64-BIT

    I am currently running Windows XP 64 bit professional and by the instructions on the Microsoft Web site, we would be led to believe that the UPDATES are still supported.  I could not update recently... (for a while, actually) and I let it slide.  Now