Supported Features for Conversion From Adobe Photoshop to JavaFX

When you develop artwork in Adobe Photoshop and use JavaFX Production Suite to convert to JavaFX graphics format, 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:

  • Grayscale, 8-bits per channel

  • RGB, 8 bits per channel

  • RGB, 16 bits per channel

Images are converted in the same mode as the original.

Note: If artwork is not in the one of the supported modes, the menu item Save for JavaFX is disabled.

Gradients

Photoshop has several types of gradients, and they are supported in the following ways:

  • Gradient overlays are exported as an effect, which means the Export Effects checkbox must be selected as a Save option.
  • Gradient fill layers are always exported as gradients, whether the Export Effects checkbox is selected or not.
  • Gradient layer blends and other types of gradients are exported in PNG files.

Layers and Groups

  • For text layers, the default option is to rasterize text, in which case each text layer is saved as a PNG file. If you clear the Rasterize Text checkbox Save option, the text is converted to an FXD Text element.

  • Other types of layer are converted to PNG files. The size of image is determined from the size of the bounding box of pixels with nonzero opacity.

  • 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, 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, source, 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.

Notes about layer effects:

  • You must select the Export Effects checkbox when saving for effects to be converted to JavaFX.
  • 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. 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 created under the Filter menu are saved in the PNG file for that layer.

Layer Masks

  • Layer masks are converted as grayscale 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.

  • 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.

Vector Masks

    Vector masks are exported by default as an SVGPath element in the FXD description. By choosing Rasterize Vector Masks as a Save option, you can save a vector mask as a PNG file. Rasterizing images is particularly useful for mobile applications.

Clipping Masks

In the example shown in Figure 1, the top layer (the mountain scene) has a clipping mask (indicated by the down arrow in the layer). This top layer is called the clipped layer. The lower layer with text is called the base layer.

Example of Clipping Mask in Adobe Photoshop 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 clear the Rasterize Texts checkbox when saving), and the base layer is applied to the clipped layer as a blend effect (SRC_IN).

Note: The Save option Rasterize Vector Masks has no effect on how clipping masks are exported. It applies to Photoshop vector masks only.

The converted JavaFX Data File (FXD) description for this clipping example is as follows:

Source Code: JavaFX Data File (FXD) Description for a Clipping Mask
FXD {
	clip: Rectangle { x:0 y:0 width:510 height:136 }
	content: [
		ImageView {
			x: 37
			y: 31
			image: Image {
				url: "Vacation.png"
			}
		},
		ImageView {
			x: 37
			y: 0
			image: Image {
				url: "Scene.png"
			}
			effect: Blend {
				mode: BlendMode.SRC_IN
				bottomInput: Identity {
					x: 37.00
					y: 31.00
					source: Image {
						url: "Vacation.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 Production Suite preview screen when you save for JavaFX in Adobe Photoshop
  • In JavaFX Graphics Viewer, a utility in the JavaFX Production Suite installation
  • In the NetBeans IDE