<commit_before>#!/usr/bin/env perl

use v5.14;
use strict;
use warnings;
use FindBin;
use lib "$FindBin::RealBin/lib";

package ImageMama;
use Moo;
has image => (
    is => "rw",
    required => 1
);

with "ImageMunger";

package main;
use Imager;

my $img = Imager->new( file => $ARGV[0]);
$img = $img->convert( preset => "grey" );
$img->write( file => "/tmp/grey.png" );

my $mama = ImageMama->new( image =>  $img );
$mama->cut_margin;
$mama->clean_outlier_pixels2;

$mama->image->write( file => "/tmp/out.png" );<commit_msg>let $ARGV[1] be the output file name.<commit_after>#!/usr/bin/env perl

use v5.14;
use strict;
use warnings;
use FindBin;
use lib "$FindBin::RealBin/lib";

package ImageMama;
use Moo;
has image => (
    is => "rw",
    required => 1
);

with "ImageMunger";

package main;
use Imager;

my $img = Imager->new( file => $ARGV[0]);
$img = $img->convert( preset => "grey" );
$img->write( file => "/tmp/grey.png" );

my $mama = ImageMama->new( image =>  $img );
$mama->cut_margin;
$mama->clean_outlier_pixels2;

$mama->image->write( file => $ARGV[1] );
{'fraction_non_alphanumeric': 0.20522388059701493, 'fraction_numerical': 0.013059701492537313, 'mean_word_length': 4.133971291866029, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 35, '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': '7616838', 'n_tokens_mistral': 449, 'n_tokens_neox': 434, 'n_words': 108}