46
46
gboolean success = TRUE;
48
return_vals = gimp_run_procedure ("gimp_image_convert_rgb",
50
GIMP_PDB_IMAGE, image_ID,
48
return_vals = gimp_run_procedure ("gimp-image-convert-rgb",
50
GIMP_PDB_IMAGE, image_ID,
53
53
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
77
77
gboolean success = TRUE;
79
return_vals = gimp_run_procedure ("gimp_image_convert_grayscale",
81
GIMP_PDB_IMAGE, image_ID,
79
return_vals = gimp_run_procedure ("gimp-image-convert-grayscale",
81
GIMP_PDB_IMAGE, image_ID,
84
84
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
95
95
* @palette_type: The type of palette to use.
96
96
* @num_cols: The number of colors to quantize to, ignored unless (palette_type == GIMP_MAKE_PALETTE).
97
97
* @alpha_dither: Dither transparency to fake partial opacity.
98
* @remove_unused: Remove unused or duplicate colour entries from final palette, ignored if (palette_type == GIMP_MAKE_PALETTE).
98
* @remove_unused: Remove unused or duplicate color entries from final palette, ignored if (palette_type == GIMP_MAKE_PALETTE).
99
99
* @palette: The name of the custom palette to use, ignored unless (palette_type == GIMP_CUSTOM_PALETTE).
101
101
* Convert specified image to and Indexed image
103
103
* This procedure converts the specified image to 'indexed' color. This
104
* process requires an image of type GIMP_GRAY or GIMP_RGB. The
104
* process requires an image in RGB or Grayscale mode. The
105
105
* 'palette_type' specifies what kind of palette to use, A type of '0'
106
106
* means to use an optimal palette of 'num_cols' generated from the
107
107
* colors in the image. A type of '1' means to re-use the previous
120
120
gimp_image_convert_indexed (gint32 image_ID,
121
GimpConvertDitherType dither_type,
122
GimpConvertPaletteType palette_type,
124
gboolean alpha_dither,
125
gboolean remove_unused,
126
const gchar *palette)
128
GimpParam *return_vals;
130
gboolean success = TRUE;
132
return_vals = gimp_run_procedure ("gimp_image_convert_indexed",
134
GIMP_PDB_IMAGE, image_ID,
135
GIMP_PDB_INT32, dither_type,
136
GIMP_PDB_INT32, palette_type,
137
GIMP_PDB_INT32, num_cols,
138
GIMP_PDB_INT32, alpha_dither,
139
GIMP_PDB_INT32, remove_unused,
140
GIMP_PDB_STRING, palette,
121
GimpConvertDitherType dither_type,
122
GimpConvertPaletteType palette_type,
124
gboolean alpha_dither,
125
gboolean remove_unused,
126
const gchar *palette)
128
GimpParam *return_vals;
130
gboolean success = TRUE;
132
return_vals = gimp_run_procedure ("gimp-image-convert-indexed",
134
GIMP_PDB_IMAGE, image_ID,
135
GIMP_PDB_INT32, dither_type,
136
GIMP_PDB_INT32, palette_type,
137
GIMP_PDB_INT32, num_cols,
138
GIMP_PDB_INT32, alpha_dither,
139
GIMP_PDB_INT32, remove_unused,
140
GIMP_PDB_STRING, palette,
143
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
145
gimp_destroy_params (return_vals, nreturn_vals);
151
* gimp_image_convert_set_dither_matrix:
152
* @width: Width of the matrix (0 to reset to default matrix).
153
* @height: Height of the matrix (0 to reset to default matrix).
154
* @matrix_length: The length of 'matrix'.
155
* @matrix: The matrix -- all values must be >= 1.
157
* Set dither matrix for conversion to indexed
159
* This procedure sets the dither matrix used when converting images to
160
* INDEXED mode with positional dithering.
162
* Returns: TRUE on success.
167
gimp_image_convert_set_dither_matrix (gint width,
170
const guint8 *matrix)
172
GimpParam *return_vals;
174
gboolean success = TRUE;
176
return_vals = gimp_run_procedure ("gimp-image-convert-set-dither-matrix",
178
GIMP_PDB_INT32, width,
179
GIMP_PDB_INT32, height,
180
GIMP_PDB_INT32, matrix_length,
181
GIMP_PDB_INT8ARRAY, matrix,
143
184
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;