lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I suspect anything serious has to be native code.

One trick I use sometimes is as follows.

A utility png2pnm is part of the libpng distribution. Can be compiled
into a small executable. (plain C source)

This can be invoked and the result piped ( io.popen() ) into Lua, either
as ASCII or (much smaller) binary, potentially a horribly large array of
pixel colours.

The Lua struct library will allow binary decode.

This is obviously a slow process but acceptable for some things. If I
have hundreds of images to process it might take 20 minutes, not
important. (doing graphical plot decode back to numbers)

On 31/05/2013 18:14, meino.cramer@gmx.de wrote:
> Hi,
> 
> is there any lua image processing library / tool / etc. to extract
> all colors from an (not necessarily indexed) image, sort the color
> by either hue, saturation or value and generate another image with 
> all these colors lists?
> 
> Since I may have to rearrange the colors in the output I want that 
> in lua code.
> 
> Is there any such program?
> 
> Thank you very much in advance for any help!
> 
> Have a nice weekend!
> Best regards,
> mcc
> 
> 
> 
> 
> 
>