need to reduce a bunch of images to 16 color

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Anon
Posts: 1
Joined: 2014-05-05T20:13:05-07:00
Authentication code: 6789

need to reduce a bunch of images to 16 color

Post by Anon »

need to reduce a bunch of images to 16 colors

"convert" command and "-colors" parameter does not work

i keep getting "Invalid Parameter - -colors"

here's what i get

Code: Select all

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\USER>cd C:\Users\USER\Pictures\Z\User\Screenshots\1\1\tales runner\1

C:\Users\USER\Pictures\Z\User\Screenshots\1\1\tr\1>cd "C:\Users\USER\P
ictures\Z\User\Screenshots\1\1\tales runner\1"

C:\Users\USER\Pictures\Z\User\Screenshots\1\1\tr\1>convert *.jpg -colo
rs 16 *.jpg
Invalid Parameter - -colors

C:\Users\USER\Pictures\Z\User\Screenshots\1\1\tr\1>convert *.jpg -colo
rs 16 *.png
Invalid Parameter - -colors

C:\Users\USER\Pictures\Z\User\Screenshots\1\1\tr\1>cd "C:\Users\USER\P
ictures\Z\User\Screenshots\1\1\tales runner\2"

C:\Users\USER\Pictures\Z\User\Screenshots\1\1\tr\2>convert *.png -colo
rs 16 *.png
Invalid Parameter - -colors

C:\Users\USER\Pictures\Z\User\Screenshots\1\1\tr\2>
or i do

Code: Select all

>convert *.png -colo
rs 16 *.png
and i get

[/code]
Invalid Parameter - -colors
[/code]

i found information about it here

http://www.imagemagick.org/script/comma ... php#colors

but again it doesn't work

what i'm trying to do is take all the files in the folder
and convert them into new files but with the same names as before
if it's possible

also in some cases i'm trying to convert jpg to png as well

but if i could get imagemagick to work the new files owudl be png
and would be converted to 16 colors later

also i'm using irfanview and greenshot to take screenshots.
irfanview offers any . jpg file size you want with plugins.
greenshot offers reduction to 256 colors but not 16 colors.

i tried editing their source code but it failed and no one helped me.

also if this is broken or isn't added yet
then i hope it's added very soon or right away
or like during this year, quarter, month, week, day, hour, right now, whatever.
unlike greenshot's developers who didn't help me and said they had more to do.

tl;dr
how do you mass convert files to 16 colors or 4-bitg with imagemagick?

edit:
p.s. i'm doing it to reduce the file size
so any settings to reduce file size as well would be nice
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: need to reduce a bunch of images to 16 color

Post by fmw42 »

convert *.png -colo
rs 16 *.png
You cannot split a command into two lines that way. If you want to do that in Windows, you must use ^ at the end of the line and typically after a full word. See http://www.imagemagick.org/Usage/windows/

Furthermore, you cannot use convert with wild cards for the output image. You must use mogrify to work on a directory of images or create a loop on convert. See http://www.imagemagick.org/Usage/basics/#mogrify
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: need to reduce a bunch of images to 16 color

Post by snibgo »

The line breaks are just a copy-paste problem. More serious is:

Code: Select all

Invalid Parameter - -colors
This means ImageMagick isn't being run. The error message is from Microsoft's "convert" program, which converts a FAT volume to NTFS. See http://www.imagemagick.org/Usage/windows/#convert_issue
snibgo's IM pages: im.snibgo.com
Post Reply