Skip to content

Commit a521e98

Browse files
committed
Fixed saving of greyscale images.
For greyscale images it used to only copy values to the first channel, rather than to all three. This has now been fixed.
1 parent 927daeb commit a521e98

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "save-pixels",
3-
"version": "2.3.3",
3+
"version": "2.3.4",
44
"description": "Saves an ndarray as an image to a file",
55
"main": "save-pixels.js",
66
"directories": {

save-pixels.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function handleData (array, data, frame) {
3535
ops.assign(
3636
ndarray(data,
3737
[array.shape[0], array.shape[1], 3],
38-
[4, 4 * array.shape[0], 0]),
38+
[4, 4 * array.shape[0], 1]),
3939
ndarray(array.data,
4040
[array.shape[0], array.shape[1], 3],
4141
[array.stride[0], array.stride[1], 0],
@@ -53,7 +53,7 @@ function handleData (array, data, frame) {
5353
ops.assign(
5454
ndarray(data,
5555
[array.shape[0], array.shape[1], 3],
56-
[4, 4 * array.shape[0], 0]),
56+
[4, 4 * array.shape[0], 1]),
5757
ndarray(array.data,
5858
[array.shape[0], array.shape[1], 3],
5959
[array.stride[0], array.stride[1], 0],

0 commit comments

Comments
 (0)