KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Generate transparent images with the TRANSFORM PICTURE command
PRODUCT: 4D | VERSION: 19 | PLATFORM: Mac & Win
Published On: July 11, 2023

The TRANSFORM PICTURE command includes a list of unique operators that change the display of the inputted image. The Transparency operator in particular converts all pixels in of a certain color to transparent pixels, hence, turning the picture into a transparent image.



This operator only requires the hexadecimal RGB color value of the pixels that will be transformed into transparent pixels. With this flexibility, you can essentially remove any background color of any image, as long as you know the color value to remove.

When using this command, you must make sure that the resulting image is in PNG picture format, to account for the transparent pixels. It is important to note that the command can have its caveats when dealing with images that were previously converted from another format into PNG (e.g., when done so with the CONVERT PICTURE command).

When converting from an image format with lower image quality (e.g., JPG or JPEG) into a PNG image, the Transparency operator may not remove the background as nicely, because the command only removes pixels of a single specified color. In this case, it is best to use source images already in PNG format.