Welcome to the Power Users community on Codidact!
Power Users is a Q&A site for questions about the usage of computer software and hardware. We are still a small site and would like to grow, so please consider joining our community. We are looking forward to your questions and answers; they are the building blocks of a repository of knowledge we are building together.
How to make background transparent and trim to content
Question
Is there a way in grafx2
to make the background transparent and trim to content?
This could be done during save.
My process now when making images for documents is:
- Make image in
grafx2
. - Open image in
gimp
. - Add alpha layer.
- Select background by color.
- Clear (it is now transparent).
- Crop to content.
It would be very convenient to have grafx2
achieve this.
Example Images
Before
NOTE: The black bar at the bottom is due to the entire page not properly filling white in
grafx2
.
After
1 answer
The following users marked this post as Works for me:
User | Comment | Date |
---|---|---|
mcp | (no comment) | Jan 16, 2023 at 15:27 |
I don't know if or if not this is possible from within grafx2, but your manual workflow can be simplified dramatically by using image magick. The following command will do all your steps at once and reproducibly:
convert test.gif -transparent white -gravity south -chop x60 -trim output.png
Explanation of the steps:
-
convert
: calls the convert command from the image magick bundle (it may be called differently if you use windows) -
test.gif
: name of the input file -
-transparent white
replaces the white background with a transparent background -
-gravity south -chop x60
: cuts off 60 pixel from the bottom of the image to get rid of the black bar (the exact number might need find tuning, that was just my quick estimate) -
-trim
: will remove all superfluous space around your shape -
output.png
: name of the resulting file
(depending on how you make your documents, one might even incorporate this conversion into your document making workflow)
1 comment thread