question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Generated image background is grey. Potentially related to new version of gm

See original GitHub issue

This wasn’t happening until a week ago or so.

I’ve noticed that ImageGraphick released a new version 7.1.0-22 a week ago, but running the convert manually generates a transparent background, instead of this ugly greyish one.

Same happens when converting to jpg, but running it manually creates a white background.

As I said, this started happening only a week ago, when I probably accidentally upgraded it using brew, and I can’t seem to install an older version (not sure how to setup paths on macos…)

Steps to reproduce

install and get a reference correct output:

brew install graphicsmagick
brew install imagemagick
convert sample.pdf output.png

and then, if you were to run this example on the same pdf, the result will have a greyed background.

screenshot of the actual pdf:

Screenshot 2022-02-04 at 15 33 12

generated png:

kz8fjvnb 1

in case it’d be useful, here are my options for the app I’m running this on:

{
    density: 96,
    saveFilename,
    savePath: destinationPath,
    format: "png",
    height: finalHeight,
    width: finalWidth,
  }

if you can’t really help me, maybe you could teach me how to install older versions of ImageGraphick so I could see if those work well?

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
runwayfourcommented, Feb 9, 2022

@irgipaulius I have had the same issue and had forked the code to see if I could fix it, when I noticed that it seems better when using imagemagick vs graphicsmagick. i.e. when doing a conversion like this:

const fp = fromPath(filepath, options); fp.setGMClass(“imagemagick”); /* This being the key difference */ let r = await fp.bulk(pageIdx, false)

Hope that helps a) you fix your issue and b) the maintainers debug things if its deemed to be an issue!

0reactions
LukeBrandoncommented, Feb 16, 2022

@irgipaulius Thank you for that. I’ll have to check that out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

GraphicsMagick GM Utility
Name Mode Description 3FR r‑‑ Hasselblad Photo RAW 8BIM rw‑ Photoshop resource format 8BIMTEXT rw‑ Photoshop resource text format
Read more >
Annotated List of Command-line Options - ImageMagick
Background : Set any fully-transparent pixel to the background color, while leaving ... It generates an image of the appropriate size colors by...
Read more >
gm(1) - Linux man page
Gm display is a machine architecture independent image processing and display ... This option composites the image on a new background color (-background) ......
Read more >
GM's new software platform will enable over-the-air updates ...
GM's new software platform will enable over-the-air updates, in-car subscriptions, and maybe facial recognition.
Read more >
Remove the background of a picture in Office - Microsoft Support
Learn how to remove the background from a picture in a Microsoft Office file. Use the automatic background removal or ... Newer versionsOffice...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found