From b46be04fc6659e5df787359b5dfbffbe2e2ffac7 Mon Sep 17 00:00:00 2001 From: Kangning Li Date: Thu, 7 Jun 2018 15:00:21 -0400 Subject: [PATCH] load greyscale images as luminance instead of alpha --- lib/loadImage.js | 2 +- specs/lib/loadImageSpec.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/loadImage.js b/lib/loadImage.js index c238a27..b9b4fda 100644 --- a/lib/loadImage.js +++ b/lib/loadImage.js @@ -96,7 +96,7 @@ function getChannels(colorType) { function getFormat(channels) { switch (channels) { case 1: - return WebGLConstants.ALPHA; + return WebGLConstants.LUMINANCE; case 2: return WebGLConstants.LUMINANCE_ALPHA; case 3: diff --git a/specs/lib/loadImageSpec.js b/specs/lib/loadImageSpec.js index 3554d83..8a5dccc 100644 --- a/specs/lib/loadImageSpec.js +++ b/specs/lib/loadImageSpec.js @@ -60,7 +60,7 @@ describe('loadImage', function() { expect(loadImage(grayscaleImage, defaultOptions) .then(function(info) { expect(info.transparent).toBe(false); - expect(info.format).toBe(WebGLConstants.ALPHA); + expect(info.format).toBe(WebGLConstants.LUMINANCE); expect(info.source).toBeDefined(); expect(info.extension).toBe('.png'); }), done).toResolve();