canvas-operations
Advanced tools
Comparing version 2.0.2 to 2.0.3
21
index.js
@@ -6,2 +6,12 @@ 'use strict'; | ||
var canvasWidth = 28; | ||
var canvasHeight = 28; | ||
var canvas = new Canvas(canvasWidth, canvasHeight); | ||
var ctx = canvas.getContext('2d'); | ||
global.CanvasRenderingContext2D = {}; | ||
global.CanvasRenderingContext2D.prototype = ctx; | ||
require('canvas-5-polyfill'); | ||
ctx.strokeStyle = 'black'; | ||
ctx.strokeWidth = 2; | ||
var resize = function(input) { | ||
@@ -58,10 +68,3 @@ let pixelsArray = input.pixelsArray; | ||
var getPixelsForStockData = function(data) { | ||
var canvasWidth = 28; | ||
var canvasHeight = 28; | ||
var canvas = new Canvas(canvasWidth, canvasHeight); | ||
var ctx = canvas.getContext('2d'); | ||
global.CanvasRenderingContext2D = {}; | ||
global.CanvasRenderingContext2D.prototype = ctx; | ||
require('canvas-5-polyfill'); | ||
ctx.clearRect(0,0, canvasWidth, canvasHeight); | ||
if(!data || data.length <= 0) | ||
@@ -79,4 +82,2 @@ return []; | ||
.interpolate('basis-open'); | ||
ctx.strokeStyle = 'black'; | ||
ctx.strokeWidth = 2; | ||
var path = line(data); | ||
@@ -83,0 +84,0 @@ var p = new Path2D(path); |
{ | ||
"name": "canvas-operations", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "Used to resize handwritten pixel alpha values for nueral network pattern recognition", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5151
98