Skip to content

Commit

Permalink
Merge pull request #4220 from melissalinkert/gh-4210
Browse files Browse the repository at this point in the history
Fix float casting when autoscaling int values to byte
  • Loading branch information
sbesson authored Sep 3, 2024
2 parents 8f83c44 + be170f3 commit e4ffbe8
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1655,7 +1655,7 @@ else if (pixels instanceof int[][]) {
else if (ints[i][j] <= min) out[i][j] = 0;
else {
int diff = max - min;
float dist = (ints[i][j] - min) / diff;
float dist = (float) (ints[i][j] - min) / diff;
out[i][j] = (byte) (dist * 256);
}
}
Expand Down

0 comments on commit e4ffbe8

Please sign in to comment.