android
  #1  
Old 01-26-2008, 08:33 PM
Verlager Verlager is offline
Junior Member
 
Join Date: Jan 2008
Location: Rochester, NY
Posts: 3
Default Linux shell script for jpg conversion [question]

Does anybody know the ImageMagick mogrify CLI switch to save bmp as 16-bit R5 G6 B5 ? If you are willing to help and know something about bit depth in graphic files, please see http://www.imagemagick.org/script/co...ne-options.php and tell me what I need to add to output bmp files as 16-bit R5 G6 B5

Of course I will credit you when the script is done.

This is what I have so far: ~$ cat mog_e200.sh

Code:
#!/bin/bash

# EXPERIMENTAL! NOT READY! DO NOT USE!
# a shell script to convert .jpg files 
# to the correct file size/orientation/depth 
# .bmp 176x220 portrait 16-bit R5 G6 B5
# -for use with a Sandisk Sansa e200 series 
#  ImageMagick (Linux) http://www.imagemagick.org

# NOTE: GIMP ADVANCED OPTIONS FOR 16-BIT .bmp FILE SAVE:
# 16 bits: R5 G6 B5 ; A1 R5 G5 B5 ; X1 R5 G5 B5
# (the options for 24-bit and 32-bit can be ignored here)
# notice that after processing the source file, 
# it can be loaded into GIMP, saved as 16-bit R5 G6 B5 (still .bmp)
# -then xfer'd to Sansa e2xx, and will be rendered OK.

# ALSO: after processing as per below, the resultant bmp file(s)
# could *probably* be batch processed by SMC in Windows XP


# TESTING PHASE WORKS ONLY A SINGLE .JPG FILE
# USAGE: mog_e200.sh {filename} NOTE: NO SUFFIX!!

# IMAGEMAGICK COMMAND LINE SWITCHES:
# http://www.imagemagick.org/script/command-line-options.php

# TIP: DO NOT USE JPG FORMAT FOR INTERMEDIATE WORKING IMAGES!
mogrify -format png $1.jpg

mogrify -rotate 90\>  $1.png
mogrify -resize 176x220! $1.png  
mogrify -depth 16 $1.png  
mogrify -format bmp $1.png
rm $1.png
Reply With Quote

Advertisement [Remove Advertisement]

  #2  
Old 01-28-2008, 12:14 AM
cpchan's Avatar
cpchan cpchan is offline
Ultra Senior Member
 
Join Date: Feb 2007
Location: Toronto, Ontario
Posts: 2,012
Default

Don't know. I very seldom work with bmp files and have no interest. Have you tried one of the ImageMagick mailinglists?

http://www.imagemagick.org/script/mailing-list.php

Charles
Reply With Quote

  #3  
Old 01-28-2008, 10:14 PM
Verlager Verlager is offline
Junior Member
 
Join Date: Jan 2008
Location: Rochester, NY
Posts: 3
Default

Quote:
Originally Posted by cpchan View Post
Don't know. I very seldom work with bmp files and have no interest. Have you tried one of the ImageMagick mailinglists?

http://www.imagemagick.org/script/mailing-list.php

Charles
Wonderful! Thanks for sharing that personal tidbit with the community! Anyone else who doesn't know (or has no interest) please PM me or post that fact here, if you could. -TIA!

And, yes, I also posted my original question to the imagemagick mailing list.

I use Linux Mint, a Debian/Ubuntu derivative, and the repository version of ImageMagick was dated 10/27/07, -too old. Even getting the newer (01/27/2008) version compiled, installed and working was a task! But it was worth it, imho.
Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 10:44 AM.