Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    Ambience convert from 540x960 jpegs by LInux script

    Reply
    Kaacz | # 1 | 2014-02-12, 03:57 | Report

    Hi,

    Jolla gallery app create ambience by crop way. This is not good.

    I wrote really simple linux shell script for expand standard 540x960 wallpaper jpeg file to Jolla Ambience 540x1600 jpeg by ImageMagick tool "convert". For use on Linux desktop. Jolla phone have not ImageMagick tools ..

    Code:
    #! /bin/bash
    
    [ -z $1 ] && echo "Run: $0 file_name.jpg" ; exit 2
    
    wpdir=`dirname "$1"`
    wpname=`basename "$1"`
    
    convert "${wpdir}/${wpname}" -crop 540x1+0+0 +repage "tmp_first.jpg"
    convert "${wpdir}/${wpname}" -crop 540x1+0+959 +repage "tmp_last.jpg"
    convert "tmp_first.jpg" -duplicate 115,0 -append -blur 0x8 "tmp_top.jpg"
    convert "tmp_last.jpg" -duplicate 261,0 -append -blur 0x8 "tmp_end1.jpg"
    convert "tmp_end1.jpg" -fill black -draw 'color 0,0 reset' "tmp_end2.jpg"
    convert "tmp_top.jpg" "${wpdir}/${wpname}" "tmp_end1.jpg" "tmp_end2.jpg" -append "ambience_${wpname}"
    
    rm -f tmp_*.jpg
    Script simply read "name.jpg" from script parameter, create top blurred expansion from first pixel line, bottom blurred expansion from last line and rest black space, then montage all to one 540x1600 "ambience_name.jpg" file to current directory.

    Good with clean first/last lines. Right input size 540x960 pixels not checked/fixed!
    But on internet are thousand 540x960 pictures/wallpapers.

    540x960_input_file_example and 540x1600_ambience_output

    Any better solutions are welcome..

    PS: sorry for my ugly english..

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by Kaacz; 2014-03-03 at 19:11.
    The Following 7 Users Say Thank You to Kaacz For This Useful Post:
    HtheB, Jordi, minimos, MINKIN2, mrsellout, mscion, Schturman

     
    mced | # 2 | 2014-02-12, 08:54 | Report

    It shouldn't be hard to compile under Sailfish, even if it's a "low featured" ImageMagick.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to mced For This Useful Post:
    Schturman

     
    HtheB | # 3 | 2014-02-12, 09:04 | Report

    a simple gui would make wonders for all Sailfish OS users

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to HtheB For This Useful Post:
    Jordi

     
    Schturman | # 4 | 2014-02-12, 19:02 | Report

    Originally Posted by HtheB View Post
    a simple gui would make wonders for all Sailfish OS users
    I will try.. Like before via terminal...

    PS. how to run your script ?

    PS2. from where you installed imagemagick package ?

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by Schturman; 2014-02-12 at 19:21.
    The Following 2 Users Say Thank You to Schturman For This Useful Post:
    HtheB, Jordi

     
    Kaacz | # 5 | 2014-03-03, 19:23 | Report

    Originally Posted by Schturman View Post
    PS. how to run your script ?
    Write jpeg file as parameter, only one file.
    For batch-run two ways is possible
    1) "envelope" to cycle with find "*.jpg"
    2) call from other script with find and using xargs - my way on MPU desktop ..

    Originally Posted by
    PS2. from where you installed imagemagick package ?
    I use it on desktop PC.
    But for SailfishOS - Done by NielDK in OpenRepos.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to Kaacz For This Useful Post:
    Schturman

     
    Schturman | # 6 | 2014-03-03, 21:30 | Report

    Originally Posted by Kaacz View Post
    Write jpeg file as parameter, only one file.
    For batch-run two ways is possible
    1) "envelope" to cycle with find "*.jpg"
    2) call from other script with find and using xargs - my way on MPU desktop ..
    I use it on desktop PC.
    But for SailfishOS - Done by NielDK in OpenRepos.
    Thanks, I will play with it

    Edit | Forward | Quote | Quick Reply | Thanks

     
vBulletin® Version 3.8.8
Normal Logout