Make all output PNGs be 8bpp RGB format

This commit is contained in:
XANTRONIX Development 2016-05-17 20:48:03 -05:00
parent 0699bba50d
commit 06a1e9048d
2 changed files with 3 additions and 3 deletions

View file

@ -260,7 +260,7 @@ static int dither(int argc, char **argv) {
goto error_buf_malloc_bufin;
}
if ((bufout = buf_malloc(in->width, in->height, (int)in->bpp)) == NULL) {
if ((bufout = buf_malloc(in->width, in->height, 3)) == NULL) {
fprintf(stderr, "%s: %s: %s\n",
argv[0], "malloc()", strerror(errno));
@ -276,7 +276,7 @@ static int dither(int argc, char **argv) {
cammy_image_dither(bufout, bufin, in->width, in->height, in->bpp, &palette);
if ((error = png_set_data(out, in->width, in->height, in->depth, in->color_type, bufout)) < 0) {
if ((error = png_set_data(out, in->width, in->height, 8, PNG_TRUECOLOR, bufout)) < 0) {
fprintf(stderr, "%s: %s: %s: %s\n",
argv[0], "png_set_data()", argv[4], png_error_string(error));

View file

@ -152,7 +152,7 @@ void cammy_image_dither(uint8_t *dest,
g = palette->colors[value][1];
b = palette->colors[value][2];
buf_write(dest, x, y, width, r, g, b, depth);
buf_write(dest, x, y, width, r, g, b, 3);
}
}
}