loading...
Cover image for Create an RGBA histogram of a cat using Imagemagick

Create an RGBA histogram of a cat using Imagemagick

cskonopka profile image Christopher Konopka ・1 min read

How do I create a histogram of this cat image?

cat

Create a new bash script named create-histogram.sh.

# create-histogram.sh
#!/bin/bash

Provide a ".png" file

echo "PNG please ~~~~~"
read PNG

Remove ".png" from PNG

SPLICE=${PNG%????}

Create the EXPORTFILE as ".txt"

EXPORTFILE="${SPLICE}.txt"
echo $EXPORTFILE

Export a histogram ".txt" file based on the ".png"

convert $PNG -format %c histogram:info:- > $EXPORTFILE

The exported histogram will look something like this ...

header

And a here is a clip of the workflow.

gif

Posted on by:

cskonopka profile

Christopher Konopka

@cskonopka

Christopher Konopka is a multidisciplinary artist that focuses on the cross section of human-computer interaction, analog video synthesis and experiential learning.

Discussion

pic
Editor guide