LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   ImageMagick -auto-level from xclip output (https://www.linuxquestions.org/questions/linux-general-1/imagemagick-auto-level-from-xclip-output-4175736567/)

Sima86 04-30-2024 05:48 AM

ImageMagick -auto-level from xclip output
 
Greetings,

iam currently working on a project that processes images from a gallery.

Iam using a Raspberry Pi to clip a certain image url.

The image is usualy a bit too dark, so i would like to use
convert a.jpeg -auto-level a.jpeg (replaces the original image)

My second command takes the output of xclip (url) and downloads the file
sudo wget -A jpeg -O /home/pi/upload/a.jpeg $(xclip -o)


I want to combine both commands into one,
problem is, the image is generated when wget writes it.

so could i do something like this:
convert $(wget -A jpeg -O /home/pi/upload/a.jpeg $(xclip -o)) -auto-level /home/pi/upload/a.jpeg
?

my whole script currently looks like this
Quote:

#!/bin/bash
while true
do
image=/home/pi/Desktop/a.jpeg
upath=/home/pi/upload/
wget -A jpeg -O $image $(xclip -o)
convert $image -auto-level $image
sudo mv $image $upath
sleep 120
done
for reference, the convert -auto-level command https://imagemagick.org/script/comma...php#auto-level


All times are GMT -5. The time now is 06:41 PM.