[SOLVED] mostly- scripting display -loop 0 infinite

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
geoland
Posts: 74
Joined: 2015-05-14T05:11:38-07:00
Authentication code: 6789

[SOLVED] mostly- scripting display -loop 0 infinite

Post by geoland »

Hi. I want to keep looping files until the display window is closed - space bar forward and backspace backward, ad-infinitum.

Edits follow...

Presently, the loop completes 3 times and closes.

Version: ImageMagick 6.8.9-9 Q16 x86_64 2016-06-01

Should I be using animate instead?

Code: Select all

files=*.ppm

	for i in $files; do

	display -delay 0 -loop 0 -coalesce -normalize -gamma 3 -resize 1024x768 *.ppm

	done

	fi
Last edited by geoland on 2016-06-15T02:23:31-07:00, edited 3 times in total.
Version: ImageMagick 7.0.7 (latest compiled from source) Q32 x86_64 (as of) 2018 - 04 - 31 xubuntu
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: sripting display -loop 0 infinite

Post by magick »

Use `animate` to loop indefinitely.
geoland
Posts: 74
Joined: 2015-05-14T05:11:38-07:00
Authentication code: 6789

Re: scripting display -loop 0 infinite

Post by geoland »

The problem with using animate is that frames cannot be deleted. In that File Delete is not available.

animate on my version of IM does not accept -contrast or -normalize which I need to display what are otherwise near linear images.

I imagine this is a bash scripting question - closing the display window or selecting File Quit in the window. That's the ideal behaviour for the application.
Last edited by geoland on 2016-06-15T02:26:14-07:00, edited 1 time in total.
Version: ImageMagick 7.0.7 (latest compiled from source) Q32 x86_64 (as of) 2018 - 04 - 31 xubuntu
geoland
Posts: 74
Joined: 2015-05-14T05:11:38-07:00
Authentication code: 6789

[SOLVED] mostly- Re: scripting display -loop 0 infinite

Post by geoland »

This was the best I could come up with. Suggestions for improvement? Perhaps better mogrify contrast settings. -normalize does a different thing in display and animate and I would like the animation and editing windows to look the same.

Code: Select all

#!/bin/bash
#ifs.sh

# A blink script

# testing only

# rm -f *.txt
# rm -f processlist

# generate half size preview - change raw extension to suit

	dcraw -o 0 -w -H 2 -h *.CR2

	previews=$(ls *.ppm)
	
	mogrify="mogrify $previews -auto-gamma -normalize"
	
	animate="animate -delay 50 -loop 0  -resize 800x600 -page 800x600 $previews"
	
	display="display -resize 800x600 -page 800x600 $previews"

	$mogrify | $animate | $display

#	control animation from window menu or space / backspace and note low quality previews
#	delete previews in display window with Ctrl D or from display menu - space / backspace
#	create a process list to convert retained image files later - without deleting source files

	IFS=:
	list=$(ls *.ppm)

	echo $list > processlist

# create separate files from processlist - if required?

	awk 'BEGIN { FS = ":" } ; { print > $0".txt" }' processlist

# delete previews

	rm -f *.ppm
	
killall blink1

exit
Version: ImageMagick 7.0.7 (latest compiled from source) Q32 x86_64 (as of) 2018 - 04 - 31 xubuntu
Post Reply