Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Imagemagick for digital foto frame 480x234
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
OpaPiloot  
View profile  
 More options Nov 12 2007, 10:37 am
Newsgroups: comp.graphics.misc
From: OpaPiloot <me@forget._it>
Date: Mon, 12 Nov 2007 16:37:41 +0100
Local: Mon, Nov 12 2007 10:37 am
Subject: Imagemagick for digital foto frame 480x234
The popular 480x234 digital foto frame has an odd aspect ratio.
Its resolution is not as specified 480/234, but after trying to count
the pixels
I think it's 416x234, which corresponds to an aspect ratio of 16:9 i.e.
1.7778
However, I noticed that 832x468 pictures are displayed notably sharper
than 416x234.
When preparing pictures with my favorite photo editor, I crop all foto's
in landscape format,
not wider than 16:9.
Normally, narrower pictures will have black borders at both sides when
displayed.
I wanted these borders in a color that is the average of the picture.
I use Imagemagick convert to shrink the picture to 1x1 and then use the
color of this pixel.
This appears to work wonderfully.
Then I use Imagemagick montage to make 832x468 pictures with optional
side borders.

The following script runs on my windows XP system, with the MKS (Unix
lookalike) toolset and Imagemagick installed.
It should also run with Cygwin and under Linux or other Unix lookalikes.
Besides convert and montage, sh, od and awk are used.
Maybe there is a more elegant way to obtain the average color, but I
don't know it.

####################################################################
#!sh
# current directory contains source JPG files
# $DES is where the prepared JPG files are stored
# $TMP is a temporary directory
GEO=832x468 # geometry of target JPG files and resize value
#
for F in *.jpg
do
convert -resize 1x1 "$F" "$TMP/1x1.bmp"
od -A n -j 54 -t u1 "$TMP/1x1.bmp" | awk -v f="$F" -v des="$DES/" -v
geo="$GEO" '
{
 print "montage -geometry", geo, "-resize", geo, "-background rgb\\(" $3
"," $2 "," $1 "\\) \"" f "\" \"" des f "\"";
 exit;

}'

done | sh -x
####################################################################

--
Have fun, Bert


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.