Created
September 3, 2018 20:42
-
-
Save emanchado/a17af6c80959732a952d7c0bce1b7cea to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; This Gimp script creates a 64x64 version of the given flag from the Mutant standard icon set: | |
;; https://mutant.tech/use/#mastodon | |
;; | |
;; Save in your ~/.gimp-2.8/scripts directory. | |
;; You can call it as follows: | |
;; gimp -i -b '(batch-prepare-square-pattern "pattern.png")' -b '(gimp-quit 0)' | |
;; It will create the file "pattern-square.png" with the final, 64x64 square version. | |
(define (batch-prepare-square-pattern pattern-path) | |
(let* ((pattern-image (car (gimp-file-load RUN-NONINTERACTIVE pattern-path pattern-path))) | |
(pattern-layer (car (gimp-image-get-active-layer pattern-image)))) | |
(plug-in-autocrop RUN-NONINTERACTIVE pattern-image pattern-layer) | |
(gimp-image-crop pattern-image 80 80 8 8) | |
(gimp-image-scale pattern-image 64 64) | |
(let* ((pattern-basename (car (strbreakup pattern-path "."))) | |
(final-filename-png (string-append pattern-basename "-square.png"))) | |
(gimp-file-save RUN-NONINTERACTIVE pattern-image pattern-layer final-filename-png final-filename-png)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment