Reply
Thread Tools
benny1967's Avatar
Posts: 3,790 | Thanked: 5,718 times | Joined on Mar 2006 @ Vienna, Austria
#1
Is there any way to make beautiful squircle-icons as defined here from any square bitmap image without going through a drag- and click- and resize-orgy in a GUI-driven application?

What I want is something like
Code:
./iconmaker.sh inputfile.jpg -o outputfile.png
where iconmake.sh would make sure the image is square (cut otherwise), resizes it and then applies all the magic (masks, highlights,...) necessary.

There as to be a way because this is basically what happens to the website-icon on the fly when you "bookmark" it.

Is this a service on the device itself that the browser uses and that I could invoke from a shell script as well?
If not: Would it possible to do this from the command line on my Ubuntu box, using, say, imagemagick? I used imagemagick a while back for other purposes and found it quite powerful, but I don't know if it can handle layers, masks etc.
 

The Following User Says Thank You to benny1967 For This Useful Post:
qwazix's Avatar
Moderator | Posts: 2,622 | Thanked: 5,447 times | Joined on Jan 2010
#2
There must be a utility on the device but I can't find it. If you have php-cli I can post a script that does just that.
__________________
Proud coding competition 2012 winner: ρcam
My other apps: speedcrunch N9 N900 Jolla –– contactlaunch –– timenow

Nemo UX blog: Grog
My website: qwazix.com
My job: oob
 

The Following 2 Users Say Thank You to qwazix For This Useful Post:
benny1967's Avatar
Posts: 3,790 | Thanked: 5,718 times | Joined on Mar 2006 @ Vienna, Austria
#3
I experimented a bit with the composite command from the ImageMagick package.
Taking the mask and the overlay- and highlight-layers from the original Nokia icon toolkit, I was able to reproduce something that looks like the reference image I created in The Gimp. (There's still some experimenting to be done with the "-compose" parameter and I still don't understand how to put it all into one command line without creating intermediate images, but it's a good start.)

The only real issue I'm having with the result now is image quality. Using PNG only (for all the layers, masks and the original image), the result is very pixelated compared to one of the original icons found on the N9. To be more precise, the borders are just not as smooth as they should be. See the attached image for a comparison (left is the ImageMagick result, right the original Nokia icon.)
Attached Images
 
 

The Following 2 Users Say Thank You to benny1967 For This Useful Post:
nicolai's Avatar
Posts: 1,637 | Thanked: 4,424 times | Joined on Apr 2009 @ Germany
#4
Hey,

based on the meegotouch theme avatar-mask and avatar-frame icons:


convert /usr/share/themes/blanco/meegotouch/images/theme/basement/meegotouch-avatar/meegotouch-avatar-mask-large.png \( -resize 80x80 in.png \) -compose Minus -composite out.png

or with frame

convert /usr/share/themes/blanco/meegotouch/images/theme/basement/meegotouch-avatar/meegotouch-avatar-frame-large.png \( /usr/share/themes/blanco/meegotouch/images/theme/baseme
nt/meegotouch-avatar/meegotouch-avatar-mask-large.png \( -resize 80x80 in.png \) -compose Minus -composite \) -compose Plus -composite out2.png


where in.png is your input image file.

(left without frame, right with frame)
Attached Images
 

Last edited by nicolai; 2011-11-27 at 14:45.
 

The Following 3 Users Say Thank You to nicolai For This Useful Post:
benny1967's Avatar
Posts: 3,790 | Thanked: 5,718 times | Joined on Mar 2006 @ Vienna, Austria
#5
Cool, so there's a number of solutions.

I played around a bit more since my last post and I think a found another variant with good results:



The full package including the mask and the layers used is here:
http://oskar.twoday.net/files/N9_Iconmaker

The command line (needs ImageMagick and the 3 PNG-files from the tarball above) is:

Code:
convert originalfile.png -resize 80x80! \
mask.png -alpha Off -compose CopyOpacity -composite \
-compose overlay overlay.png -composite \
-compose screen highlight.png -composite outputfile.png
I'm not really sure if my usage of ImageMagick is correct (in terms of: produces the same result as Photoshop with Nokias template), but it looks nice at first glance.
 

The Following 4 Users Say Thank You to benny1967 For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 04:44.