Skip to content

Add command line option --export-png-color-mode for setting bit-depth and color-type

A command line option is added (--export-png-color-mode) which resembles the export dialog's "Bit depth" setting. (Gray_1, Gray_2, ..., RGB_8, ..., RGBA_8, etc.)

Note that the dialog says "Bit depth", but internally this splits into "bit depth" and "color type". I chose the name "color-mode" to stay away from both parameters, not sure, whether there is a more appropriate name.

Similar to the code in dialog/export.cpp I map the array of valid options for color-mode to values for bit-depth and color-type. The actual arrays are copy&pasted from there.

The code style pipeline complains. (0,0,0 -> 0, 0, 0 and also the placement of "void export_png_color_mode" on different lines)

Should "void export_png_color" (in actions-output.cpp) be styled as the similar functions above it (so void on one line and function name on next) or according to the suggested corrections from the style check (same line)?

Merge request reports