This gist describes how to use the ImageMagick and OpenSSL command line tools to encrypt an image using ECB mode.
First we need to gather some information about the original image. This will tell us what size to use in our final step.
$ identify Braintree.png
Braintree.png PNG 898x229 898x229+0+0 8-bit sRGB 65KB 0.000u 0:00.000
Looks like the image is 898x229.
Next we need to convert the image into the RGBA format. This is a simple binary format that only contains uncompressed pixel data and no meta information, like image dimensions.