File tree 1 file changed +29
-0
lines changed
1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env php
2
+ <?php
3
+
4
+ require __DIR__ . '/../vendor/autoload.php ' ;
5
+
6
+ use Jcupitt \Vips ;
7
+
8
+ /* Load an image with libvips, render to a large memory buffer, wrap a imagick
9
+ * image around that, then use imagick to save as another file.
10
+ */
11
+
12
+ $ image = Vips \Image::newFromFile ($ argv [1 ],
13
+ ['access ' => Vips \Access::SEQUENTIAL ]);
14
+ $ image = $ image ->colourspace (Vips \Interpretation::RGB16 );
15
+ $ bin = $ image ->writeToMemory ();
16
+ $ imagick = new \Imagick ();
17
+ $ imagick ->setSize ($ image ->width , $ image ->height );
18
+ $ imagick ->setFormat ("rgb " );
19
+ $ imagick ->readImageBlob ($ bin , "rgb " );
20
+ $ imagick ->writeImage ($ argv [2 ]);
21
+
22
+ /*
23
+ * Local variables:
24
+ * tab-width: 4
25
+ * c-basic-offset: 4
26
+ * End:
27
+ * vim600: expandtab sw=4 ts=4 fdm=marker
28
+ * vim<600: expandtab sw=4 ts=4
29
+ */
You can’t perform that action at this time.
0 commit comments