Permalink
Browse files

Explanation for how to get this script working

  • Loading branch information...
justinrainbow committed Oct 2, 2011
1 parent 5114c1b commit 08647903d35b65a222214d40934b7626ac280266
View
@@ -0,0 +1,4 @@
+/tools/raw/*
+/tools/toprint/*
+/tools/processed/*
+.DS_Store
View
@@ -0,0 +1,4 @@
+
+
+all:
+ mkdir -p tools/{raw,processed,toprint}
View
@@ -1,10 +1,17 @@
# Photobooth
-More information to come soon...
-
## Requirements
* Sofortbild app for Mac http://www.sofortbildapp.com/
* PHP + Imagick (this dependency will be removed in future versions)
* ImageMagick
+
+
+## Installation
+
+Run the ```sh make``` command to create all the required directories.
+
+![](https://github.com/justinrainbow/photobooth/raw/master/docs/images/sofortbild-preferences.png)
+
+![](https://github.com/justinrainbow/photobooth/raw/master/docs/images/sofortbild-preferences.png)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -4,33 +4,48 @@
$processImageDir = __DIR__ . '/processed';
$toPrintDir = __DIR__ . '/toprint';
+$numberOfPhotosToUse = 3;
+
$rawImages = glob($rawImageDir . '/*.*');
$totalImages = count($rawImages);
+if ($totalImages > $numberOfPhotosToUse) {
+ // only use the last 4
+ $rawImages = array_slice($rawImages, -($numberOfPhotosToUse));
+}
+
+if (count($rawImages) < $numberOfPhotosToUse) {
+ return;
+}
+
+$images = new Imagick($rawImages);
+printf("Height: %s, Width: %s\n", $images->getImageHeight(), $images->getImageWidth());
-if ($totalImages == 4) {
- $images = new Imagick($rawImages);
+
+foreach ($images AS $image) {
+ $image->rotateImage(new ImagickPixel(), -90);
+
+ $image->thumbnailImage(600, null);
+
+ // add some contrast
+ //$image->contrastImage(1);
- printf("Height: %s, Width: %s\n", $images->getImageHeight(), $images->getImageWidth());
-
- foreach ($images AS $image) {
- $image->thumbnailImage(600, null);
-
- // add some contrast
- //$image->contrastImage(1);
-
- // add some adaptive blur
- $image->adaptiveBlurImage(1, 1);
-
- $image->borderImage(new ImagickPixel('#ffffff'), 12, 12);
-
- $image->fxImage('(1.0/(1.0+exp(10.0*(0.5-u)))-0.006693)*1.0092503');
- }
-
- $images->resetIterator();
- $canvas = $images->appendImages(true);
-
- $canvas->setImageFormat("jpg");
+ // add some adaptive blur
+ $image->adaptiveBlurImage(1, 1);
- $canvas->writeImage($toPrintDir . '/strip.jpg');
-}
+ $image->borderImage(new ImagickPixel('#ffffff'), 12, 12);
+
+ $image->fxImage('(1.0/(1.0+exp(10.0*(0.5-u)))-0.006693)*1.0092503');
+}
+
+$images->resetIterator();
+$canvas = $images->appendImages(true);
+$strip = clone $canvas;
+$strip->addImage($canvas);
+$strip->addImage($canvas);
+
+$canvas = $strip->appendImages(false);
+
+$canvas->setImageFormat("jpg");
+
+$canvas->writeImage($toPrintDir . '/strip.jpg');

0 comments on commit 0864790

Please sign in to comment.