It would be nice if the image background could be transparent instead of white (as a module setting). Since these are PNGs it doesn't seem to be complicated, would it ?

CommentFileSizeAuthor
#2 guitar.patch967 bytesfgm

Comments

floretan’s picture

Generating transparent PNGs is not difficult, but you lose anti-aliasing (see http://www.php.net/manual/en/function.imageantialias.php). However, if anyone comes up with a patch that does transparency with anti-aliasing I'd be happy to review it/commit it.

An alternative that I've been thinking about would be to replace the PNGs and render the diagrams with the HTML5 canvas element, or svg, but you would lose some cross-browser compatibility.

fgm’s picture

Status: Active » Needs review
StatusFileSize
new967 bytes

Well, there does not seem to be any antialiasing in the current version anyway.

Here is a patch adding it, along with the removal of a E_STRICT warning about using $left without assigning it.

floretan’s picture

Title: Transparent background » Add antialiasing support
Status: Needs review » Fixed

Antialiasing is not always enabled (from php.net: This function is only available if PHP is compiled with the bundled version of the GD library.). It's typically not available on Ubuntu unless you compile PHP yourself, so I wrapped the call to imageantialias($im, TRUE); with a check to make sure that the function is defined.

Thank you!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.