Note that there are some explanatory texts on larger screens.

plurals
  1. POToo much Image Reduction in Batch File using Imagemagick
    primarykey
    data
    text
    <p>I use ImageMagick to perform command line operations on images, such as resizing, reducing quality, etc. </p> <p>However, I've run into a problem with this script: </p> <pre><code>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... ) </code></pre> <p>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 2500x5000 down to 25x25, or something similar. It's really strange, since I am executing the exact same statement, albeit in a different manner. </p> <p>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. </p> <p>Why is it reducing so small, and how can I fix it?</p> <p>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. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload