Below see how to use this software to create a simple, purple, 100px * 100px PNG image:
start() ->
erlycairo:start_link().
%% if you run multiple C-Nodes, to avoid nodename conflicts
start(CNodeNumber) ->
erlycairo:start_link(CNodeNumber).
stop() ->
erlycairo:stop().
create_images()->
rect("rect.png", 100, 100, {1.0, 0.2, 0.7, 1.0}).
rect(File, Width, Height, {Red, Green, Blue, Alpha}) ->
case erlycairo:new_image_blank(Width, Height) of
ok ->
erlycairo:set_source_rgba(Red, Green, Blue, Alpha),
erlycairo:rectangle(0, 0, Width, Height),
erlycairo:fill(),
erlycairo:write_to_png(File),
erlycairo:close_image(),
ok;
{error, Reason} ->
exit(Reason)
end.