<commit_before>#!/bin/bash

convert --version
./flow-proto1 --version
./imagew --version

mkdir turtles
rm ./turtles/*.jpg
rm ./turtles/*.png

if [[ "$OSTYPE" == "linux-gnu" ]]; then
  export MEM_COMMAND="/usr/bin/time -v"
else
  export MEM_COMMAND=time
fi

#Reduce noise for now
export MEM_COMMAND=

./fetch_images.sh

cd turtles

export IMAGE_PATH=../source_images/turtleegglarge.jpg

echo Using imageflow linearly
$MEM_COMMAND ../flow-proto1 -i $IMAGE_PATH -o flow_linear_s0_400x400.png -w 400 -h 400 --format png24 -m 100 --sharpen 0 --down-filter bspline --up-filter bspline 

echo
echo Using ImageMagick to thumbnail
$MEM_COMMAND convert $IMAGE_PATH -set colorspace sRGB -colorspace RGB -filter bspline -resize 400x400  -colorspace sRGB  magick_linear_400x400.png

echo
echo Using ImageWorsener to thumbnail
$MEM_COMMAND ../imagew -filter bspline  $IMAGE_PATH -w 400   imagew_linear_400x400.png

echo Using imageflow wrong
$MEM_COMMAND ../flow-proto1 -i $IMAGE_PATH -o flow_wrong_400x400.png -w 400 -h 400 --format png24 --incorrectgamma -m 100 --down-filter bspline --up-filter bspline 

echo
echo Using ImageMagick to thumbnail wrong
$MEM_COMMAND convert $IMAGE_PATH -filter bspline -resize 400x400 magick_wrong_400x400.png

echo
echo Using ImageWorsener with -nogamma
$MEM_COMMAND ../imagew -nogamma -filter bspline  $IMAGE_PATH -w 400    imagew_wrong_400x400.png


echo Comparing linear results without sharpening

dssim magick_linear_400x400.png flow_linear_s0_400x400.png
dssim imagew_linear_400x400.png flow_linear_s0_400x400.png


echo Comparing gamma-incorrect results<commit_msg>Turtles test - use Lanczos instead of bspline<commit_after>#!/bin/bash

convert --version
./flow-proto1 --version
./imagew --version

mkdir turtles
rm ./turtles/*.jpg
rm ./turtles/*.png

if [[ "$OSTYPE" == "linux-gnu" ]]; then
  export MEM_COMMAND="/usr/bin/time -v"
else
  export MEM_COMMAND=time
fi

#Reduce noise for now
export MEM_COMMAND=

./fetch_images.sh

cd turtles

export IMAGE_PATH=../source_images/turtleegglarge.jpg

echo Using imageflow linearly
$MEM_COMMAND ../flow-proto1 -i $IMAGE_PATH -o flow_linear_s0_400x400.png -w 400 -h 400 --format png24 -m 100 --sharpen 0 --down-filter lanczos --up-filter lanczos 

echo
echo Using ImageMagick to thumbnail
$MEM_COMMAND convert $IMAGE_PATH -set colorspace sRGB -colorspace RGB -filter lanczos -resize 400x400  -colorspace sRGB  magick_linear_400x400.png

echo
echo Using ImageWorsener to thumbnail
$MEM_COMMAND ../imagew -filter lanczos  $IMAGE_PATH -w 400   imagew_linear_400x400.png

echo Using imageflow wrong
$MEM_COMMAND ../flow-proto1 -i $IMAGE_PATH -o flow_wrong_400x400.png -w 400 -h 400 --format png24 --incorrectgamma -m 100 --down-filter lanczos --up-filter lanczos 

echo
echo Using ImageMagick to thumbnail wrong
$MEM_COMMAND convert $IMAGE_PATH -filter lanczos -resize 400x400 magick_wrong_400x400.png

echo
echo Using ImageWorsener with -nogamma
$MEM_COMMAND ../imagew -nogamma -filter lanczos  $IMAGE_PATH -w 400    imagew_wrong_400x400.png


echo Comparing linear results without sharpening

dssim magick_linear_400x400.png flow_linear_s0_400x400.png
dssim imagew_linear_400x400.png flow_linear_s0_400x400.png


echo Comparing gamma-incorrect results
{'fraction_non_alphanumeric': 0.08721291123525761, 'fraction_numerical': 0.06641837368094351, 'mean_word_length': 4.292282430213465, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5383910', 'n_tokens_mistral': 1330, 'n_tokens_neox': 1134, 'n_words': 331}