Go Back   Sat Universe > Dreambox (SD Models) > Other Dreambox Files > Dreambox Tutorials

Note: Visitors from certain countries might see in-text advertising(underlind words in posts) or pop-under ads.
It is only shown to unregistered visitors or members that haven't made any posts. So you can easily get rid of it.

Loading...

Bash script for picon creation (only for linux users)

Dreambox Tutorials

Reply
  #1  
Old 21-04-2015, 19:43  Translate from English to Italian  Translate from English to French  Translate from English to German  Translate from English to Spanish  Translate from English to Dutch  Translate from English to Greek  Translate from English to Portuguese  Translate from English to Russian  Translate from English to Russian
helour helour is offline
Junior Member
 
Join Date: Aug 2009
Posts: 9
Thanks: 0
Thanked 2 Times in 2 Posts
Country: Country Flag
Default Bash script for picon creation (only for linux users)

I've wrote very simple bash script for picon (with small rounded corners) creating. You have to need install pngquant and imagemagick before script running.

PHP Code:
#!/bin/sh
#

##############################################################
#
# Input arguments:
# $1 - width of the output picon image
# $2 - height of the output picon image
# $3 - background color
# $4 - input logo file
# $5 - output picon file
#
# Example of use:
# create_picon.sh 100 60 black logo.png picon.png
#
##############################################################

width=$1
height
=$2

width_1
=$((${width} - 1))
height_1=$((${height} - 1))

scale=90 # scale in percentage
s_width=$((${width} * $scale 100))
s_height=$((${height} * $scale 100))

if [ 
"$#" -ne 5 ]; then
    
echo "Usage: `basename $0` weight height (black|white) input_file output_file"
    
exit 1
fi

TMP1
=`mktemp XXXXXXXX.png`

convert $-adaptive-resize ${s_width}x${s_height} -background None -gravity center -extent ${width}x${height$TMP1
convert 
\( -size ${width}x${heightcanvas:$-raise 1 -normalize -blur 0x5 \) $TMP1 -composite $TMP1
convert $TMP1 
-alpha set \( +clone -alpha transparent -background none -fill white -stroke none -strokewidth 0 -draw 'roundrectangle 0,0 '$width_1','$height_1' 5,5' \) -compose DstIn -composite $TMP1

pngquant $TMP1
mv 
${TMP1%.*}-fs8.png $5

rm 
-f $TMP1
rm 
-${TMP1%.*}-fs8.png 
Reply With Quote
Reply


Thread Tools
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 +2. The time now is 12:16.


Powered by vBulletin
Copyright ©2006-2016 - Sat Universe