Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6029309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:52:02+00:00 2026-05-23T04:52:02+00:00

I have the following bash script (.sh) that’s working just fine in Unix. I’d

  • 0

I have the following bash script (.sh) that’s working just fine in Unix. I’d like to convert into a batch (.bat) file for use with ImageMagick for Windows but I’m having a bit of trouble with the conversion.

Original GIT repo for the Unix script(s):

https://github.com/AndreyChernyh/imagemagick-filters

ImageMagick version for Windows:

http://www.imagemagick.org/download/binaries/ImageMagick-6.7.0-Q16-windows.zip

earlybird.sh:

#!/bin/bash

SOURCE=$1

# Prepare
rm -f result.jpg source_copy.jpg mask.png
convert $SOURCE -fill rgba\(251,243,213,1.0\) -colorize 100% fill.jpg
convert assets/earlybird/mask.png -resize `identify -format "%wx%h" $SOURCE`\! mask.png
cp $SOURCE source_copy.jpg

# Run
convert fill.jpg $SOURCE -compose multiply -gravity center -composite - |
convert - -modulate 101,68,100 - |
convert - -gamma 1.19 - |
convert - -channel red +level 10.5%,100% - |
convert - -modulate 105,120 - |
convert - -modulate 100,83,100 - |
convert - -level 0%,92%,0.92 - |
convert mask.png - -compose ColorBurn -composite - |
convert mask.png - -compose Multiply -composite result.jpg

# Cleanup
rm -f source_copy.jpg fill.jpg

# Open
open $SOURCE result.jpg

This is what I have so far, but it’s not working as intended as I’m not sure what the batch file equivalent of multiple command line arguments are: e.g., “\” or “|” or whether it’s even possible. I read somewhere that the equivalent is a caret “^” but again, I’m not 100% sure how to implement it properly.

@echo off

set SOURCE=%1

del result.jpg
del source_copy.jpg
del mask.png

convert.exe %SOURCE% -fill rgba(251,243,213,1.0\) -colorize 100% fill.jpg
convert.exe assets\earlybird\mask.png -resize 1024x768 mask.png

copy %SOURCE% source_copy.jpg

convert.exe fill.jpg %SOURCE% -compose multiply -gravity center -composite - ^
convert.exe - -modulate 101,68,100 - ^
convert.exe - -gamma 1.19 - ^
convert.exe - -channel red +level 10.5%,100% - ^
convert.exe - -modulate 105,120 - ^
convert.exe - -modulate 100,83,100 - ^
convert.exe - -level 0%,92%,0.92 - ^
convert.exe mask.png - -compose ColorBurn -composite - ^
convert.exe mask.png - -compose Multiply -composite result.jpg

del source_copy.jpg
del fill.jpg

WORKING CODE:

This is what I’ve done after applying @Gabe‘s answer. No errors and it’s working flawlessly!

@echo off

set SOURCE=%1

del result.jpg
del source_copy.jpg
del mask.png

conv %SOURCE% -fill rgba(251,243,213,1.0) -colorize 100%% fill.jpg
conv assets\earlybird\mask.png -resize 604x453 mask.png

copy %SOURCE% source_copy.jpg

conv fill.jpg %SOURCE% -compose multiply -gravity center -composite - |^
conv - -modulate 101,68,100 - |^
conv - -gamma 1.19 - |^
conv - -channel red +level 10.5%%,100%% - |^
conv - -modulate 105,120 - |^
conv - -modulate 100,83,100 - |^
conv - -level 0%%,92%%,0.92 - |^
conv mask.png - -compose ColorBurn -composite - |^
conv mask.png - -compose Multiply -composite result.jpg

del source_copy.jpg
del fill.jpg
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T04:52:02+00:00Added an answer on May 23, 2026 at 4:52 am

    You’re pretty close. The big problems I see are that you have an extra \ in rgba(...), you need to escape your % signs (like %%), and you need to put | before the line continuation characters (like |^). Try this:

    @echo off
    
    set SOURCE=%1
    
    del result.jpg source_copy.jpg mask.png
    
    convert.exe %SOURCE% -fill rgba(251,243,213,1.0) -colorize 100%% fill.jpg
    convert.exe assets\earlybird\mask.png -resize 1024x768 mask.png
    
    copy %SOURCE% source_copy.jpg
    
    convert.exe fill.jpg %SOURCE% -compose multiply -gravity center -composite - |^
    convert.exe - -modulate 101,68,100 - |^
    convert.exe - -gamma 1.19 - ^
    convert.exe - -channel red +level 10.5%%,100%% - |^
    convert.exe - -modulate 105,120 - |^
    convert.exe - -modulate 100,83,100 - |^
    convert.exe - -level 0%%,92%%,0.92 - |^
    convert.exe mask.png - -compose ColorBurn -composite - |^
    convert.exe mask.png - -compose Multiply -composite result.jpg
    
    del source_copy.jpg fill.jpg
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to do following: I have a bash script that calls an
I have a bash script that looks like the following: #!/bin/bash FILES=public_html/*.php # */
I have a shell script file (run.sh) that contains the following: #!/bin/bash %JAVA_HOME%/bin/java -jar
I have the following bash script: #DIR is something like: /home/foo/foobar/test/ without any whitespace
I have the following bash script, that lists the current number of httpd processes,
I'm working with a bash script that has the following syntax $ declare -a
I have a bash script that basically should work like below: get build number
I have a following bash script: 1 #!/bin/bash 2 query='query= SELECT * WHERE {
I have a bash script that is invoked from a cron job which has
I have a bash-script (let's call it /usr/bin/bosh ) using the following she-bang line:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.