The only thing I can think of is to assert on the function. It’s a strange module in that it mutates too! Perhaps try this and see if you get any exceptions?
image = :egd.create(100, 100)
# Use any color with alpha = 0
:ok = :egd.filledRectangle(image, {0, 0}, {99, 99}, :egd.color({25, 123, 0, 0}))
:edg.save(image, "image.png")
Edit:
Hmmm since you get a solid color image I guess the filledRectangle/4 call is working as expected.
I get an exception, but because not calling render first makes image invalid type for save. render returns Binary::binary() which save excepts. Before call to render, image is of type Image::egd_image().