> From: Raul Miller
> Sent: Wednesday, 11 August 2010 03:01
> 
> So... I use gethttp to retrieve a png image which I want to manipulate
> in J.
> 
> png=:gethttp'http://rosettacode.org/mw/images/c/c6/Pentagon.png'
> 
> What is the simplest way to convert that raw data to an array of pixel
> values?
> 
> As near as I can tell, media/image3 wants me to write the data
> to a file, which strikes me as a needless complication.  But,
> worse than that, when I do write the png as a file, and use read_png
> or pal_read_png on the file name, I get an empty result.

I would suggest looking at the media/platimg addon.

Here is the start of my investigations of that RC task.

require 'media/platimg trig viewmat numeric'
Img=: readimg jpath '~Projects/Pentagon.png'
theta=: rfd i.180
xy=: 4$.$. _1 > Img

Ht=: xy (+/ .*) (cos ,: sin) theta
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to