IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
snibgo
Posts: 12159 Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK
Contact:
Post
by snibgo » 2015-08-27T11:38:18-07:00
Wikipedia shows the same process as IM "-separate":
Code: Select all
for (var i = 0; i < data.length; i += 4) {
var grayscale = data[i];
data[i] = grayscale; // red
data[i + 1] = grayscale; // green
data[i + 2] = grayscale; // blue
}
fmw42
Posts: 25562 Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA
Contact:
Post
by fmw42 » 2015-08-27T11:39:19-07:00
OK. So your javascript needs all 3 channels the same. But where do you save the file to disk and in what format?
baxter stockman
Posts: 16 Joined: 2015-07-31T12:35:27-07:00
Authentication code: 1151
Contact:
Post
by baxter stockman » 2015-08-27T12:46:00-07:00
I post it back to the canvas and then save it as a png:
Code: Select all
var dataURL = canvas.toDataURL('image/png');
baxter stockman
Posts: 16 Joined: 2015-07-31T12:35:27-07:00
Authentication code: 1151
Contact:
Post
by baxter stockman » 2015-08-27T12:48:55-07:00
@snibgo: so does that mean a channel separation is just taking one value and then using the same value for all three channels?
snibgo
Posts: 12159 Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK
Contact:
Post
by snibgo » 2015-08-27T13:07:32-07:00
Yes.
Users browsing this forum: No registered users and 21 guests