#!/bin/bash

size=$(du -b "$1" | cut -f 1)
pixels=$((($size+2)/3))
edge=$(($pixels / $(bc -l <<< "scale=0;sqrt($pixels)")))
dd if=/dev/zero bs=$edge count=3 2>/dev/null | cat "$1" - | \
	convert -verbose -size ${edge}x$edge -depth 8 rgb:- "$1.$size.png"
ls -l "$1" "$1.$size.png"
