Page 1 of 1
Multi window pane
Posted: 2009-05-02T20:57:27-07:00
by jmmiller57
I have 9 pictures hanging on my wall close together. I want to take a large picture and crop it so it looks like i'm looking out 9 small windows. Not sure how to do this? I want to make this very accurate. pleas help with this.. thanks..
Re: Multi window pane
Posted: 2009-05-02T23:35:50-07:00
by anthony
I think an exmple of the image may be needed.
Also what will you be looking through the windows AT?
Re: Multi window pane
Posted: 2009-05-03T00:46:00-07:00
by jmmiller57
A picture of a golf course
Re: Multi window pane
Posted: 2009-05-03T00:52:40-07:00
by Bonzo
If you want a looking out the widow effect you could just draw white bars on the lrger photo as this will obscure some areas ?
There is a similar discussion here:
viewtopic.php?f=1&t=13632&hilit=crop
I have done something using php that you could probably change if you want to use the crop method:
Code: Select all
<?php
// Original image
$image = '../original_images/sunflower.jpg';
// Amount of images in x
$qty_x = '4';
// Amount of images in y
$qty_y = '3';
// Get the size of the original image
$size = getimagesize($image);
// Size to crop the images to
// code modified as per sugestion of Dave to prevent problems with left over parts of the divided image).
$crop_x = round( $size[0]/$qty_x + 0.5);
$crop_y = round( $size[1]/$qty_y + 0.5 );
// Canvas for combined images - it will be trimmed to the finished image size in the code
$width = ( $size[0] * 1.5 );
$height = ( $size[1] *1.5 );
// Crop the image
exec("convert $image -crop {$crop_x}x{$crop_y} image-%d.jpg");
// Remove the .jpg from the filenames
foreach (glob("*.jpg") as $filename) {
$file = str_replace('.jpg', '', $filename );
exec("convert $filename -background black +polaroid $file.png");
}
// Delete tempory images
foreach (glob("*.jpg") as $filename) {
unlink($filename);
}
// Set $command variable
$command = "";
// Loop through generating the image layout
for ($j = 0; $j < $qty_y; $j++) {
for ($i = 0; $i < $qty_x; $i++) { $n = $j>0 ? $qty_x*($j)+$i : $i;
$offset_x= ( ($crop_x * $i ) + rand(2, 25));
$offset_y=( ($crop_y * $j ) + rand(2, 25));
$command .= " image-$n.png -geometry +$offset_x+$offset_y -composite" ; }
}
// Produce the combined image
exec( "convert -size {$width}x{$height} xc:#262b38 $command -trim combined.jpg");
// Delete tempory images
foreach (glob("*.png") as $filename) {
unlink($filename);
}
?>
Re: Multi window pane
Posted: 2009-05-03T16:09:06-07:00
by fmw42
Bonzo,
Very nice effect.
Fred