So I dug in ImageMagick's convert documentation, and came up with the following code that converts the PDF file into a PNG with a transparent background:
convert -density 600 figure.pdf -channel alpha \ -fx '((r == 1 && g == 1 && b == 1) ? 0 : 1)' figure.png
There are still some few points that look white but are probably not that white (due to antialiased rendering of the PDF file ?). There are many more things that can be done using the -fx
operator, this page was helpful to me !
Edit: while the alpha channel seems to be on by default for PDF files, it is not necessarily the case for all images. If the above doesn't work, try adding -alpha Set
before the -fx
bit.
26 comments:
Hi Vincent.
As a scientist myself, I understand perfectly:)
Anyhow, if the number of your PDFs is of reasonably small order, you could try to:
1. Import your PDF into GIMP
2. Use the function named, ehm, "transform color to alpha" (or something like that) in "colors" menu. Choose white.
Results are FAR better, I believe. Also, Elsevier totally digs EPS-es (and others) exported in GIMP, so it is one of my primary 'publication' tools:)
I wish your papers good reviews.
regards
w.
That's a good tip: the quality is indeed better: while with imagemagick there is still a bit of white lingering around the black lines of the chemical figure, gimp does the thing properly.
I have no clue what is the difference, though, since in principle that's the same rendering engine (ie ghostscript). They must be using different options (there are so many).
Downside is, it's not command-line enough for me ;-)!
Thanks for your kind words !
Got it, it's aliasing. If I convert to PPM beforehand using pdftoppm and disabling antialiasing or using the option +antialias, it looks better (though still not as good as gimp, I wonder how they do it !)
I visited your site.I liked your sites.You wrote about the background removal.It is very helpful for using photoshop.I will visite your site again as soon as possible.
Would tikz and its associated packages for chemical plotting not work for this particular use case?
you could try opening the pdf in inkscape. that will allow you to ungroup the image, identify the background plane, and remove it. that way, your vector graphics will stay vector graphics. (worst case you'd have to run the pdf through pdf2ps/ps2pdf before.)
Resourceful Photoshop tutorial about Background remove of Image. This tutorial helps to grow up image editing technique.
Ghost Mannequin Editing Service
Photo Retouch Up
Knockout Service Provider
That is wonderful tutorial about background remove. thanks for sharing this useful post.
Clipping Creations India | ecommerce image editing service
With adobe photoshop it seems easier to delete the background
Really it was amazing post. Thank you for sharing with us.
Some truly interesting info, well written and broadly user-friendly.
clipping path service|Photo Retouching services|Vector Tracing
Enjoyed reading the article on top of, explains everything in detail, the article is extremely fascinating and effective to Clipping Path Lab. Thank you and smart luck for the approaching articles
Remove background from this app easily with out any designing skill.
Background Remover
its so important to take your time with the pics and try to get the best out of it. great. thank you. abbasiMohamd
I have finally understood how to apply them to my own pictures! Thanks, amanatullas
Thank you for this post, it’s really helpful, especially as my blog is pretty new, abbasiMohamd
I’m just starting out and I find it really challenging to get the background right, it’s probably just as important as the outfit if you ask me! cory brown
Finally i learned how to remove background easily.
Clipping Path
This is very informative post. Thanks for sharing.
Photo Retouching Services
This is an excellent blog you have shared. I have read and appreciated it guy. Clipping Path | Remove White Background | Product Photo Editing
Remove background from this app easily without any designing skill.
You can use Ghost Mannequin Effect
Photography is my passion, from my childhood life I am doing work in this sector. Love to write blogs on photography tips and tutorials also publish on various platforms. Last 5 years, I am working dedicatedly in this industry. Here I would like to share my Professional knowledge which has proper guidelines to enhance my newbie photography career. Thank you
Are you a photographer looking to enhance your images and take your work to the next level? Check out this article on photo editing services for photographers. Discover how outsourcing your photo editing can save you time and help you deliver high-quality, professional results to your clients. Learn about the different types of photo editing services available, from basic retouching to advanced photo manipulation, and find out how to choose the right service provider for your needs. Read on to learn more and take your photography business to new heights!
Very good and more effective resources, thanks a lot
I’m always uplifted after reading your posts thank you for being such a reliable source of positivity
Visit Here: 3d modeling service
Post a Comment