Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP, manipulating very big image files without loading them into RAM

I've been searching about this for a while but I didn't find what I wanted, so here is my problem:

using PHP, I want to create a very big image file,lets say 20000 gigapixels, then I want to add a small image to specific location on this big image. My computer doesn't have enough RAM to load up the entire image and manipulate pixels that way, so I think I need to access the image data on hard disk and manipulate them in some way, so anyone knows how to do this? thanks for helping me out :)

like image 460
Alireza Mn Avatar asked Oct 21 '22 15:10

Alireza Mn


1 Answers

ImageMagick supports operations on very large files. I don't see support in the PHP/ImageMagick API but you could call out (exec) to the command line program and use one of it's disk caching or streaming options.

There is some documentation for dealing with large files here: www.imagemagick.org.

like image 86
andrewmu Avatar answered Oct 27 '22 10:10

andrewmu