- ~/code/guides/ctf/write-ups-2015/pragyan-ctf-2015/misc/255_255_255_is_the_best_color/go.py
ffmpeg -framerate 75 -i 'input%04d0000.png' output.gif
# `-delay n`: 100/n FPS
# `-loop 0`: repeat forever
convert -delay 2 -loop 0 input*.png output.gif
# SVG to PNG
for i in *.svg ; do inkscape -z -f "${i}" -w48 -h48 -e "${i%.svg}.png" ; done
# PCD to PNG
find . -name "*.pcd" -type f -exec convert '{}[5]' ../../pngs/'{}'.png \;
{
# magic, width, height, max component value
echo "P3 250 250 255"
for ((y=0; y<250; y++)) {
for ((x=0; x<250; x++)) {
# r, g, b
echo "$((x^y)) $((x^y)) $((x|y))"
}
}
} | convert ppm:- png:- >foo.png
Alternatives:
- NetPBM:
pnmtopng < foo.ppm > foo.png
layer > transform > offset
duplicate layer gaussian blur invert colours layer tab > mode > overlay
duplicate layer gradient tool layer tab > mode > addition
https://orbitingweb.com/blog/optimizing-png-images/
# highlight differences
compare i1.png i2.png -metric RMSE o.png
# render differences
composite i1.png i2.png -compose difference o.png
import numpy as np
from PIL import Image
data = np.zeros((2000,2000,4), dtype=np.uint8)
for i in range(100):
for j in range(100):
#modify_file("flag_{}_{}.jpg".format(i,j))
im = Image.open("flag_{}_{}.png".format(i,j))
array = np.array(im.getdata()).reshape(20,20,4)
data[20*i:20*(i+1), 20*j:20*(j+1)] = array
img = Image.fromarray(data, 'RGBA')
img.save('flag.png')
montage -mode concatenate -tile 1x in-*.jpg out.jpg
https://superuser.com/questions/290656/combine-multiple-images-using-imagemagick
# 1366x768
convert in.png -crop "$((1366-$((1366-752+2))))x$((768-$((768-464+26))))+1+26" out.png
# 1/3 of 1366x768
convert in.png -crop "$((490-20-2))x$((736-10-34))+11+34" out.png
- python - selenium webdriver
save_screenshot()
+ PillowImageChops.difference()
- {!} changes in one element displace others => compute diff in DOM tree, style only changed elements
- GitHub - redecheck/redecheck: Automatically Detecting Layout Failures in Responsive Web Pages
- ~/Downloads/ReDeCheck - An Automatic Layout Failure Checking Tool for Responsively Designed Web Pages.pdf
- user-defined layout constraints checked against different viewports
http://www.imagemagick.org/discourse-server/viewtopic.php?t=27719
With G'MIC plugin:
Details > Sharpening
- Richardson-Lucy Deconvolution
- Gold-Meinel Deconvolution
Filters > Distorts > Whirl and Pinch...
Frequency Domain Image Compression and Filtering | Hacker News