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

  • Home
  • SEARCH
  • 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 7986645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:54:51+00:00 2026-06-04T11:54:51+00:00

I use ImageMagick to perform command line operations on images, such as resizing, reducing

  • 0

I use ImageMagick to perform command line operations on images, such as resizing, reducing quality, etc.

However, I’ve run into a problem with this script:

SETLOCAL ENABLEDELAYEDEXPANSION
@echo off
REM Make the Modified folder, to store resized images. 
if not exist %CD%\Mod MKDIR %CD%\Mod

REM loop through all files in working directory with extensions of .bin
for /r %CD% %%G in (*.bin) do ( 
  set FILENAME=%%~nG

  echo !FILENAME!.bin conversion beginning...
  echo Beginning conversions...
  echo Convert to TIF

  REM rename the bin file with a .TIF extension. 
  copy !FILENAME!.bin  !FILENAME!.tif
  echo resizing image....
  REM convert the tif and resize it to 25%. This is where it reduces to almost nothing!
  convert !FILENAME!.tif -resize 25% !FILENAME!.tif
  echo Renaming file...
  REM rename file to say it had been modified
  ren !FILENAME!.tif !FILENAME!-mod.tif
  echo Copying file...
  REM copy the file to the Mod directory.
  copy /y !FILENAME!-mod.tif %CD%\Mod
  echo Cleaning up...
  REM cleanup.
  DEL !FILENAME!-mod.tif
  echo Moving on to next file...

)

If I run the command that resizes the image from the command line, it works fine, and reduces the image to the estimated size. In the script, it reduces to extraordinarily small dimensions, we’re talking about going from around 2500×5000 down to 25×25, or something similar. It’s really strange, since I am executing the exact same statement, albeit in a different manner.

I had originally assumed that it was the for loop acting up, but I stepped through it, pausing as I went, and it resized with that one execution, ensuring that it was not the for loop constantly resizing the image by 25% until it was too small to go any further.

Why is it reducing so small, and how can I fix it?

Edit 1: The reason it’s converting bin files is because all of the BIN files are actually TIF files that have been renamed with the bin extension for whatever reason. They are, in fact, images.

  • 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-06-04T11:54:52+00:00Added an answer on June 4, 2026 at 11:54 am

    I would guess you need to escape the % with another % so 25% becomes 25%%

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

Sidebar

Related Questions

How can you use imagemagick from python without opening a new command line window
From command line with imagemagick, you can use: convert dragon.gif -resize 64x64^ -gravity center
When I open a command window in windows and use the imagemagick convert command:
I'm trying to use imagemagick to generate some images of Kannada text. The problem
I have some websites that use ImageMagick to convert images and place them in
What's the difference between RMagic, ImageMagick, GD, etc. and which one should I use?
I have to use imagemagick convert command from php. So I'm using shell_exec but
I'm attempting to use ImageMagick along w/ Paperclip to handle the images on my
So I'm using command line execs with php to perform Image Magick converts, and
I use the ImageMagick Magick++ API to work with images in my C++ program.

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.