Image Rendering Script

In this article: An image rendering script allows you to use a script to render an image format which is not supported by the built-in image renderers. Each image rendering script defines a custom image format along with the script which renders it, and the format will be listed in the format drop-down field just like the built-in formats. Image rendering scripts are supported by PixelViewer 2026.1 and later.

Creating and Managing

There are 2 ways to open dialog to manage image rendering scripts:

Through Tools Menu

Windows/Linux Users

  1. Click at right hand side of toolbar.
  2. Click 'Tools > Manage Image Rendering Scripts…' in menu.

macOS Users

  1. Click 'Tools > Manage Image Rendering Scripts…' in menu at top of screen.

Through Rendering Parameters Panel

  1. Find the drop-down field of image format in 'Rendering parameters' panel.
  2. Click [Create Script…] below the drop-down field.
If the format of the current image is already provided by an image rendering script, you can click [Edit Script] below the drop-down field to edit that script directly. The image will be rendered again once the script is applied.

Defining the Format

Besides the script itself, the following are defined by each image rendering script:
  • Name
    The name of the format shown in the drop-down field of image format.
  • Output Color Format
    The format of the bitmap buffer which the script writes rendered pixels into. It can be Bgra32 (8-bit for each color component) or Bgra64 (16-bit for each color component).
  • Selectable Byte Ordering
    Whether the byte ordering of source image data can be selected by user or not.
  • Adjustable Color Pre-Correction
    Whether the gains of red, green and blue color can be adjusted by user or not.
  • Planes
    One or more planes of the format. The following are defined by each plane:
    • Pixel-Stride
      The number of bytes of each pixel of the plane. Set to 0 means that pixels of the plane are packed in bits instead of bytes.
    • Effective Bits
      The minimum and maximum number of effective bits of each pixel of the plane, which can be selected by user.
    • Adjustable B/W Levels
      Whether the black level and white level of the plane can be adjusted by user or not.
The values selected by user according to the definitions above will be provided to the script when rendering the image.

Scripting Basics

Please refer to Scripting in Application for the basics of scripting.
Unlike the other types of script, an image rendering script runs on a background thread every time when the image needs to be rendered. Therefore, interacting with user is not supported inside an image rendering script.

Languages

You can use the following languages to create Image Rendering Scripts:

Writing with an AI Tool

You can let an AI tool write the script for you. The Skill below teaches it the API of image rendering scripts. It produces the script along with the settings to enter in the editor, which you copy into PixelViewer yourself. Please refer to Installing Skills for AI Tools to install it.
The AI tool cannot access PixelViewer. It only writes the script and tells you which settings to use.
A script is not sandboxed and runs with the same permission as PixelViewer. Please read and understand a script generated by an AI tool before enabling script execution.