Natenoms Wiki

Weil Teilen Spaß macht :)

User Tools

Site Tools


Sidebar

Translations of this page:

Navigation



Lizenz dieses Wikis
Über dieses Wiki
Feed des Wikis
Impressum


Was gerade in meinem Blog geschieht:

en:linux:kde:servicemenues:schatten

Table of Contents

Create shadowed image with ImageMagic

I personally like screenshots with a small shadow; with the following Linux/KDE/Service_Menu you can create such images with a right click in Dolphin.

Some background is written here (German).

Example

The original image without shadow and on the right side with a shadow:

Files

create_shadow.desktop
[Desktop Entry]
ServiceTypes=KonqPopupMenu/Plugin,image/*
Type=Service
Actions=create_shadow;
X-KDE-ServiceTypes=KonqPopupMenu/Plugin
MimeType=application/octet-stream;
X-KDE-Submenu=Images
 
[Desktop Action create_shadow]
Name=Create a shadow around the image
Icon=document-edit
Exec=create_shadow.sh %f
create_shadow.sh
#!/bin/bash
 
_file="${1}"
_directory=$(dirname "$_file")
_filename=$(basename "$_file")
convert "${_file}" -gravity northwest -background 'rgba(255,255,255,0)' -splice 10x10 \( +clone -background 'rgba(95,95,95,0)' -shadow 80x3+0+0 \) +swap -background none -mosaic +repage \( +clone -background 'rgba(95,95,95,0)' -shadow 80x3-0-0 \) +swap -background none -mosaic +repage "${_directory}/shadow_${_filename}"
#If the original file should be overwritten, comment out the previous line and remove # from the next line...
#convert "${_file}" -gravity northwest -background 'rgba(255,255,255,0)' -splice 10x10 \( +clone -background 'rgba(95,95,95,0)' -shadow 80x3+0+0 \) +swap -background none -mosaic +repage \( +clone -background 'rgba(95,95,95,0)' -shadow 80x3-0-0 \) +swap -background none -mosaic +repage "${_file}"

The ImageMagick line was taken from the “Hard Shadow” plugin in the Shutter project.

Preview

en/linux/kde/servicemenues/schatten.txt · Last modified: 2017/02/20 12:53 by Natenom