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 7034707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:13:06+00:00 2026-05-28T01:13:06+00:00

#!/bin/bash dir=/posix/path/to/folder cd $dir color1 = #816c51 color2 = #5a4a3b color3 = #1c110f for

  • 0
#!/bin/bash

dir="/posix/path/to/folder"
cd "$dir"

color1 = "#816c51"
color2 = "#5a4a3b"
color3 = "#1c110f"

for file in *.tiff
do
    base=${file%*.tif}
    convert -unsharp 5 "$base" "$base.ppm"
    convert -opaque white -fill white -fuzz 10% "$base.ppm" "${base}_step1.tif"
    convert -fuzz 5% -fill "$color1" -opaque "$color1" "${base}_step1.tif" "${base}_step2.tif"
    convert -fuzz 1.5% -fill "$color1" -opaque "$color2" "${base}_step2.tif" "${base}_step3.tif"
    convert -fuzz 12% -fill "black" -opaque "$color3" "${base}_step3.tif" "${base}_step4.tif"
    convert "${base}_step4.tif" "${base}_final.tif"
done

I get a couple of error:

convert: unable to open image ...
convert: missing an image filename
test.sh: line 6: color1: command not found

I’d really appreciate some help! Thanks!

  • 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-28T01:13:07+00:00Added an answer on May 28, 2026 at 1:13 am

    I’m a bit unclear on what this is trying to do (I don’t have much experience with ImageMagick), but from a Bash standpoint, I can tell you that this bit:

    for file in *.tiff
    do
        base=${file%*.tif}
    

    does not make sense: it tries to strip off a final .tif (one F) from a file-name that ends in .tiff (two F’s). You presumably meant either this:

    for file in *.tiff
    do
        base="${file%.tiff}"
    

    (which strips off the final .tiff) or this:

    for file in *.tif
    do
        base="${file%.tif}"
    

    (which finds files ending in .tif); or, perhaps, this:

    for file in *.tiff *.tif
    do
        base="${file%.tiff}"
        base="${base%.tif}"
    

    (which handles both cases).

    You also probably want to explicitly check for the case that "$base" is '*' (which will happen, for example, if you try to use *.tif in a directory that doesn’t contain any files matching that name).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

#! /bin/bash dir=$(find . -type f) echo ${dir[0]} echo This is dir[0] echo ${dir[1]}
Hopefully this should be a simple one... Here is my test.sh file: #!/bin/bash patch_file=/home/my
#!/bin/bash echo 'first line' >foo.xml echo 'second line' >>foo.xml I am a total newbie
#!/bin/bash if test $# == 4; then echo $*; else echo args-error >&2; fi;
With /bin/bash , how would I detect if a user has a specific directory
Linux bash script: #!/bin/bash function Print() { echo $1 } var=* Print $var Execution
Suppose a shell script (/bin/sh or /bin/bash) contained several commands. How can I cleanly
Here is my script: #!/bin/bash echo Digite o local em que deseja instalar o
I have the followign bash script to update mtimes for maildir files: #!/bin/bash for
I have a simple test bash script which looks like that: #!/bin/bash cmd=rsync -rv

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.