diff --git a/bin/main.c b/bin/main.c index 8165d8d..306bf0c 100644 --- a/bin/main.c +++ b/bin/main.c @@ -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)); diff --git a/src/image.c b/src/image.c index 0446727..968afb4 100644 --- a/src/image.c +++ b/src/image.c @@ -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); } } }