charmbracelet / freeze

Generate images of code and terminal output 📸
MIT License
3.24k stars 55 forks source link

Images with shadow settings have a completely transparent background #65

Open iamjackg opened 6 months ago

iamjackg commented 6 months ago

Describe the bug If I generate an image with any shadow options, the background becomes completely transparent. It happens regardless of other settings (window, no window, border radius, etc.)

To Reproduce Steps to reproduce the behavior:

echo '# Hello' > test.md
freeze test.md -o test.md.png --shadow.blur 20 --shadow.x 10 --shadow.y 10

Expected behavior An image of the markdown file with a drop shadow.

Actual behaviour test md

Desktop (please complete the following information):

Happy to help debug!

meowgorithm commented 6 months ago

Hi! Quick question: do you have rsvg-convert installed? Will help us narrow this down.

iamjackg commented 6 months ago

I do not!

meowgorithm commented 6 months ago

Noted! If you need a workaround in the meantime I’m guessing installing rsvg-convert will solve things for you. It’s typically included in the librsvg package and is available on Linux and macOS.

iamjackg commented 6 months ago

Woah, that drastically cuts down render time too! Thanks, this'll do for now.

iamjackg commented 6 months ago

Celebrated too soon -- now it's not using the right font. Everything seems to get rendered with the default system font.

meowgorithm commented 6 months ago

Dang. If it’s not too much trouble, would you mind opening an issue for that accordingly?

maaslalani commented 6 months ago

Hey @iamjackg, thanks for flagging this. Will look into this soon! Both the background with resvg and font issues with librsvg.

agrmohit commented 5 months ago

Can reproduce it with freeze v0.1.6 on Windows 11, installed using winget.

{
  "fmt": {
    "lineWidth": 120
  }
}
freeze -c full deno.json -o deno.json.png

deno json

OS info:

Edition Windows 11 Pro
Version 23H2
Installed on    ‎2024-‎03-‎29
OS build    22635.3495
Experience  Windows Feature Experience Pack 1000.22700.1005.0