Skip to content

Commit

Permalink
Poster now uses same filters as movie
Browse files Browse the repository at this point in the history
  • Loading branch information
fstark committed Feb 13, 2022
1 parent f8f523d commit b10f0b0
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/flimencoder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,14 +408,27 @@ class flimencoder

std::cout << "POSTER INDEX: " << poster_index << "\n";

auto filters_string = profile_.filters();
poster_image = filter( poster_image, filters_string.c_str() );


image poster_small( 128, 86 );
copy( poster_small, poster_image, false );

auto prev = poster_small;
image previous( poster_small.W(), poster_small.H() );
fill( previous, 0 );

// auto prev = poster_small;
auto poster_small_bw = poster_small;
auto error_diff = get_error_diffusion_by_name( "floyd" );
// auto error_diff = get_error_diffusion_by_name( "floyd" );


error_diffusion( poster_small_bw, poster_small, prev, 0, *error_diff, 0.99, true );
if (profile_.dither()==image::error_diffusion)
error_diffusion( poster_small_bw, poster_small, previous, 0, *get_error_diffusion_by_name( profile_.error_algorithm() ), profile_.error_bleed(), profile_.error_bidi() );
else if (profile_.dither()==image::ordered)
ordered_dither( poster_small_bw, poster_small, previous );

// error_diffusion( poster_small_bw, poster_small, prev, 0, *error_diff, 0.99, true );
write_image( "/tmp/poster1.pgm", poster_image );
write_image( "/tmp/poster2.pgm", poster_small );
write_image( "/tmp/poster3.pgm", poster_small_bw );
Expand Down

0 comments on commit b10f0b0

Please sign in to comment.