DOS Generate Thumbnails with NConvert

/ Published in: DOS Batch
Save to your folder(s)

Crops and resizes, maintaining perspective, with a white background.

Copy this code and paste it in your HTML
  1. REM Copy images to processing directory
  2. xcopy /Y /C /I /E C:\Imagery\ToProcess C:\Imagery\Processing\Originals
  4. REM Copy originals to 200 folder ready for processing
  5. xcopy /Y /C /I /E C:\Imagery\Processing\Originals C:\Imagery\Processing\200x200
  7. REM Convert 200s
  8. for /R C:\Imagery\Processing\200x200 %%I in (*.jpg) do "C:\Program Files\XnView\nconvert.exe" -npcd 2 -size 256x256+0 -ctype grey -corder inter -out jpeg -sharpen 1 -autocrop 10 255 255 255 -ratio -rtype linear -rflag orient -resize 190 190 -bgcolor 255 255 255 -canvas 200 200 center "%%I"
  10. REM All done - copy images to processed directory
  11. xcopy /Y /C /I /E C:\Imagery\Processing\200x200 C:\Imagery\Processed\200x200
  12. xcopy /Y /C /I /E C:\Imagery\Processing\Originals C:\Imagery\Processed\Originals
  14. REM Remove image files from system to prevent repeated conversions of the same images
  15. DEL /F /S /Q "C:\Imagery\Processing\200x200"
  16. DEL /F /S /Q "C:\Imagery\Processing\Originals"
  17. DEL /F /S /Q "C:\Imagery\ToProcess"

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.