Fixed it! Now it works fine
This commit is contained in:
parent
1e364fe3ea
commit
d511cc407e
|
@ -257,7 +257,7 @@ int main(int argc, char **argv) {
|
|||
|
||||
for (int oy = 0; oy < 3; oy++) {
|
||||
for (int ox = 0; ox < 2; ox++) {
|
||||
unsigned char pix = quantized_image->pixels[ox + (x + (y * 3 + oy)) * 2];
|
||||
unsigned char pix = quantized_image->pixels[ox + (x + (y * 3 + oy) * args.width) * 2];
|
||||
float brightness = get_color_brightness(palette[pix]);
|
||||
if (brightness >= brightest_diff) {
|
||||
brightest_i = pix;
|
||||
|
@ -275,7 +275,7 @@ int main(int argc, char **argv) {
|
|||
for (int oy = 0; oy < 3; oy++) {
|
||||
for (int ox = 0; ox < 2; ox++) {
|
||||
if (ox == 1 && oy == 2) continue;
|
||||
unsigned char pix = quantized_image->pixels[ox + (x + (y * 3 + oy)) * 2];
|
||||
unsigned char pix = quantized_image->pixels[ox + (x + (y * 3 + oy) * args.width) * 2];
|
||||
float diff_bg = get_color_difference(palette[darkest_i], palette[pix]);
|
||||
float diff_fg = get_color_difference(palette[brightest_i], palette[pix]);
|
||||
if (diff_fg < diff_bg) {
|
||||
|
@ -285,10 +285,10 @@ int main(int argc, char **argv) {
|
|||
}
|
||||
|
||||
{
|
||||
unsigned char pix = quantized_image->pixels[1 + (x + (y * 3 + 2)) * 2];
|
||||
unsigned char pix = quantized_image->pixels[1 + (x + (y * 3 + 2) * args.width) * 2];
|
||||
float diff_bg = get_color_difference(palette[darkest_i], palette[pix]);
|
||||
float diff_fg = get_color_difference(palette[brightest_i], palette[pix]);
|
||||
if (diff_fg > diff_bg) {
|
||||
if (diff_fg < diff_bg) {
|
||||
bitmap ^= 31;
|
||||
unsigned char tmp = darkest_i;
|
||||
darkest_i = brightest_i;
|
||||
|
|
Loading…
Reference in New Issue