Supported Features for Conversion From Adobe Photoshop to JavaFX
- Skill Level Beginner
- Product JavaFX
- Key Features Tools for Graphics Designers
- Last Updated September 2009
To develop Adobe Photoshop CS3 or CS4 graphics that convert most effectively, you need to know which features are supported and some facts about how conversion to JavaFX graphics format occurs.
Modes
The following modes are supported:
- Gray scale, 8 bits per channel
- RGB, 8 bits per channel
- RGB, 16 bits per channel
Images are converted in the same mode as the original.
Layers and Groups
- Each layer is converted to a PNG file. The size of the image is determined as the size of the bounding box of pixels with nonzero opacity.
- If you clear the default option to rasterize text, each text layer is saved as a
Textobject instance rather than as a PNG file, which enables developers to modify its properties, (for example, content, font size, color, and placement).
Note: On mobile devices, all fonts are replaced by the JavaFX mobile font.
- Layer groups are converted to Group nodes in JavaFX. If the Adobe Photoshop group contains no layers, it is not converted.
Layer Effects
The following effects are converted to descriptions in the JavaFX Data File (FXD):
- Drop Shadow: Angle, distance, spread, size, color and opacity are converted. Blending and quality options are not converted.
- Outer Glow: Opacity, color, spread, and size are converted. Blending, noise, gradient color, technique, and quality options are not converted. If gradient color is used, the color of the resulting glow is defined as the starting color of the gradient.
- Inner Shadow: Angle, distance, choke, size, color, and opacity are converted. Blending and quality options are not converted.
- Inner Glow: Opacity, color, choke, and size are converted. Blending, noise, gradient color, technique, and quality options are not converted. If gradient color is used, the color of the resulting glow is defined as the starting color of the gradient.
The size parameter of these "shadow" effects is interpreted as radius. However, in JavaFX, radius does not change the size of the shadow very much.
Note: The maximum radius supported by JavaFX is 63. If the radius of a converted effect is greater than 63, it is reduced automatically.
Other layer effects that were created under the Filter menu are saved in the PNG file for that layer and appear as static effects, whether or not you select the Export Effects checkbox in the Save options during export.
Note: Dynamic effects are ignored in mobile applications. To make effects visible even though they cannot be manipulated programmatically, select the Export Effects checkbox. Clearing the Export Effects checkbox minimizes the size of the FXZ file.
Layer Masks
- Layer masks are converted as gray-scale, 8-bit images in separate PNG files.
- Color is set to 0 and opacity is set to the opacity of the layer mask. The converted layer mask is applied to the layer image as a blend effect (
SRC_IN) in JavaFX graphics.
- The layer mask is converted even if the mask is disabled for that layer.
- Layer masks for groups are not converted.
- Layer masks attached to layers with a clipping mask are not converted.
Clipping Masks
In the example shown in Figure 1, the top layer (the lake scene) has a clipping mask (indicated by the down arrow in the layer). This top layer is called the clipped layer. The bottom layer with text is called the base layer.
Figure 1: Clipping Mask in Adobe Photoshop
Both the clipped layer and the base layer are converted to PNG files (with the exception of the text if you choose not to rasterize it), and the base layer is applied to the clipped layer as a blend effect (SRC_IN).
Note: In mobile applications, only rectangles without any transformations applied are supported as Clipping shapes.
The converted JavaFX Data File (FXD) description for this example is as follows:
Group {
clip: Rectangle { x:0 y:0 width:625 height:402 }
content: [
ImageView {
id: "I_m__SO__there"
opacity: 1.0
x: 2
y: 12
image: Image {
url: "{__DIR__}I_m__SO__there.png"
},
},
ImageView {
opacity: 1.0
x: 0
y: 0
image: Image {
url: "{__DIR__}Lake_scene.png"
},
effect: Blend {
mode: BlendMode.SRC_IN
bottomInput: Identity {
x: 2
y: 12
source: Image {
url: "{__DIR__}I_m__SO__there.png"
}
}
}
},
]
}
If you want to test whether an effect will be exported, you can preview the JavaFX graphic as it will look in a desktop or mobile application in any of three ways:
- In the preview screen when you save for JavaFX in Adobe Illustrator or Adobe Photoshop
- In JavaFX Graphics Viewer
- In the NetBeans IDE
We welcome your participation in our community. Please keep your comments civil and on point. You may optionally provide your email address to be notified of repliesyour information is not used for any other purpose. By submitting a comment, you agree to these Terms of Use.