|
Hello,
What's the best way to produce/specify bitmaps/pixemaps using Erlang? Is anyone using particular modules, or projects for this? Thanks, -Gene _______________________________________________ erlang-questions mailing list [hidden email] http://erlang.org/mailman/listinfo/erlang-questions |
|
The only one open-source I know is erl_img from jungerl:
https://github.com/gebi/jungerl/tree/master/lib/erl_img Also look on github for erl_img for varoius forks. See the docs here: http://doc.erlagner.org/index.html?i=0&search=erl_img#erl_img At the end we wrote our own image file format in erlang. On May 5, 2:27 am, "G.S." <[hidden email]> wrote: > Hello, > > What's the best way to produce/specify bitmaps/pixemaps using Erlang? Is > anyone using particular modules, or projects for this? > > Thanks, > -Gene > > _______________________________________________ > erlang-questions mailing list > [hidden email]://erlang.org/mailman/listinfo/erlang-questions erlang-questions mailing list [hidden email] http://erlang.org/mailman/listinfo/erlang-questions |
|
Have you looked at egd?
http://www.erlang.org/doc/man/egd.html On May 5, 2:27 am, "G.S." <[hidden email]> wrote: } What's the best way to produce/specify bitmaps/pixemaps using Erlang? Is } anyone using particular modules, or projects for this? -- -Vance _______________________________________________ erlang-questions mailing list [hidden email] http://erlang.org/mailman/listinfo/erlang-questions |
|
Thanks, I will check both.
By the way, the purpose of use is creating Fractal Art. Regards, -Gene On Sat, May 7, 2011 at 10:56 AM, Vance Shipley <[hidden email]> wrote: Have you looked at egd? _______________________________________________ erlang-questions mailing list [hidden email] http://erlang.org/mailman/listinfo/erlang-questions |
|
On Sat, May 07, 2011 at 12:39:33PM -0700, G.S. wrote:
} By the way, the purpose of use is creating Fractal Art. In that case you may want to look at this: lib/erlang/lib/gs-1.5.13/contribs/mandel -- -Vance _______________________________________________ erlang-questions mailing list [hidden email] http://erlang.org/mailman/listinfo/erlang-questions |
|
In reply to this post by G.S.-2
Hi,
My personal take on this is that you should process the fractal algorithm in a way that's separated from any particular file format, building the image in a very generic way; e.g. perhaps using a record like -record(image, {id, width, height, pixel_depth, rgba = []}). where rgba are the generated 4-tuples {R, G, B, A} representing the data points. Then you could write transcoders (codecs) from this format to any number of binary image file formats. The binary syntax of Erlang will then prove its worth in spades. It's somewhat curious to me that a comprehensive library for image codecs hasn't emerged already, given the ease of which this can be done in Erlang's binary/bit syntax. HTH, Steve On May 7, 2:39 pm, "G.S." <[hidden email]> wrote: > Thanks, I will check both. > > By the way, the purpose of use is creating Fractal Art. > > Regards, > -Gene > > > > > > > > On Sat, May 7, 2011 at 10:56 AM, Vance Shipley <[hidden email]> wrote: > > Have you looked at egd? > > > http://www.erlang.org/doc/man/egd.html > > > On May 5, 2:27 am, "G.S." <[hidden email]> wrote: > > } What's the best way to produce/specify bitmaps/pixemaps using Erlang? Is > > } anyone using particular modules, or projects for this? > > > -- > > -Vance > > _______________________________________________ > > erlang-questions mailing list > > [hidden email] > >http://erlang.org/mailman/listinfo/erlang-questions > > > > _______________________________________________ > erlang-questions mailing list > [hidden email]://erlang.org/mailman/listinfo/erlang-questions erlang-questions mailing list [hidden email] http://erlang.org/mailman/listinfo/erlang-questions |
|
More concretely as an example, a TGA format binary could be created as
simply as this: encode(#image{id = undefined}) -> encode(#image{id = <<>>}); encode(#image{id = ID, width = W, height = H, pixel_depth = BPP, rgba = L}) -> Header = <<(byte_size(ID)), 0, 2, 0:40, 0:16, 0:16, W:16/little, H:16/ little, BPP, 0:2, 2:2, 0:4, ID/binary>>, Data = encode(L, <<>>), Trailer = <<0:64, "TRUEVISION-XFILE.", 0>>, <<Header/binary, Data/binary, Trailer/binary>>. encode([{R, G, B, A}|T], Bin) -> encode(T, <<Bin/binary, B, G, R, A>>); encode([], Bin) -> Bin. _______________________________________________ erlang-questions mailing list [hidden email] http://erlang.org/mailman/listinfo/erlang-questions |
|
In reply to this post by G.S.-2
On 05/07/2011 09:39 PM, G.S. wrote:
> Thanks, I will check both. > > By the way, the purpose of use is creating Fractal Art. > > Regards, > -Gene If you just want to get started as quickly as possible, you could write to PPM format ASCII text files (http://en.wikipedia.org/wiki/Netpbm_format) and then use pnmtotiff, pnmtojpeg, etc. (see http://netpbm.sourceforge.net/) to convert them to the format you prefer. The ASCII representation makes it easy to look at the output while you're debugging, so that right now you can focus on generating graphics rather than getting the output format right. Some tools, such as GIMP, can read/write PPM files directly, if you want to quickly view the result. /Richard _______________________________________________ erlang-questions mailing list [hidden email] http://erlang.org/mailman/listinfo/erlang-questions |
| Powered by Nabble | Edit this page |
