Skip to content

Instantly share code, notes, and snippets.

@firedynasty
Last active March 12, 2022 22:40
Show Gist options
  • Save firedynasty/02e6ca2dfb4a38bbf7e670f6be56df83 to your computer and use it in GitHub Desktop.
Save firedynasty/02e6ca2dfb4a38bbf7e670f6be56df83 to your computer and use it in GitHub Desktop.
convert multiple images, reduce transparency
convert 1.jpg -alpha set -background none -channel A -evaluate multiply 0.5 +channel 1.png
Using ImageMagick to do the convert, to make an image have 50% transparency (less ink during printing). https://imagemagick.org/index.php
----------------------------------------
for i in *.jpg; do echo $i; done
Looping through files
----------------------------------------
for i in *.jpg; do convert $i "${i%.jpg}.png"; done
test run to convert images from jpg to png.
----------------------------------------
for i in *.jpg; do convert $i -alpha set -background none -channel A -evaluate multiply 0.5 +channel "${i%.jpg}.png"; done
convert with transparency
----------------------------------------
More resources:
https://linuxize.com/post/bash-for-loop/
https://legacy.imagemagick.org/discourse-server/viewtopic.php?t=31549
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment