File:Leucospermum cultivar gradual decrease of quality.jpg

Uploaded by AzaToth
Upload date 2011-09-16T18:03:58Z
MIME type image/jpeg
Dimensions 1805 × 1200 px
File size 876.2 KB

Summary

Description
English: Visualization of decreasing JPEG quality, with lowest quality in the middle, and highest at the left and right.
Date
Source Own work based on: Leucospermum cultivar.jpg by Flying Freddy
Author AzaToth

Following code was used to modify the original image:

#!/usr/bin/perl 
use strict;
use warnings;
use v5.12;
use File::Temp qw/ tempdir /;
use Graphics::Magick;
use Math::Round qw(:all);
my $p = new Graphics::Magick;
$p->Read("Leucospermum_cultivar.jpg");
my ($width, $height) = $p->Get('width', 'height');
my $center = $width/2;
my $result = new Graphics::Magick;
$result->Set(size=>"${width}x${height}");
$result->Read();
$result->Set('quality', 100);
my $dir = tempdir(CLEANUP => 1);
my $chop = 16; # 1 MCU normally
for my $col (0..$width) {
	next if $col%$chop; 
	my $current = $p->Clone();
	$current->Crop(width => $chop, height => $height, x => $col, y => 0);
	$current->Set('quality' => round_even(100*abs(($col-$center)/$center)));
	my $filename = sprintf "%s/%05d.jpg", $dir, $col;
	$current->Write($filename);
	my $n = new Graphics::Magick;
	$n->Read($filename);
	$result->Composite( image => $n, x => $col, y => 0);
}
$result->Write('Leucospermum_cultivar_gradual_decrease_of_quality.jpg');

Licensing

w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

depicts

16 September 2011

897,223 byte

1,200 pixel

1,805 pixel

image/jpeg

fc8ec330a9eac9959a588272fa5a56f15ec91ecb

Category:CC-BY-SA-3.0 Category:Images with Perl source code Category:Leucospermum (cultivars)