On Sat 25 Feb 2017 at 04:01:43 (-0700), renyhp wrote: > Hi, > Thank you for your answers. I am actually programming something automated (a > Telegram bot for LilyPond! If you are on Telegram you will find it at > @lilypondbot), so probably the best option will be to discard using > LilyPond's cropping feature and try to find another way to crop it myself. > It is a bit sad, though, that a so powerful tool like LilyPond can't adjust > some simple things like png output margins.
IMO that would be like going to the tile store and having to buy tiles with 3mm of grout round them. One buys clean tiles and applies grout of desired width when they're laid. In my workflow, I don't use PNGs because they're already rasterised, which messes up rescaling. PDFs are much better, and there's a tool for cropping them, pdfcrop, which is bundled in the TeX Live distribution, which LilyPond users are likely to be already using: $ pdfcrop --margins <whatever> in.pdf out.pdf Adding facilities to LP for manipulating PNGs would be a big duplication of time and effort IMO. After all, where do you stop? $ gm convert -negate -trim -bordercolor red -border 10x0 -bordercolor green -border 0x8 in.png out.png looks like an over-the-top command you might use. It will convert the image to white on black, trim it (by inspecting the colour of the corner pixels), then add coloured borders to the sides and the top and bottom. Just prune that command to taste. Cheers, David. _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user