有10亿张10241024的png图片,现在需要生成它们整体的一张10241024的缩略图,也就是说,需要在逻辑上将它们拼接起来再生成一张缩略图,有什么高效的好方法吗?尝试了一下ImageMagick,100张图片就耗时很久,有没有什么快速的好方法?谢谢!
迷茫2017-04-17 15:25:12
1024*1024 = 1,048,576
1 billion pictures is 1000,000,000
Each pixel corresponds to about 1000 pictures. You can use the sampling method. Each pixel randomly selects N pictures from 1000 pictures. , then randomly select M pixels in each picture, obtain the average value as a pixel of the thumbnail, and obtain 1024*1024 pixels of the thumbnail in turn.
Can be implemented using opencv.
However, if these 1 billion pictures are random, the result will be close to a picture with a grayscale of 0.5. Because according to the central limit theorem, the variance of each pixel of the thumbnail tends to 0. You have to ensure that the combination of 1 billion pixels has structural characteristics.
巴扎黑2017-04-17 15:25:12
Again, Alibaba Cloud OSS comes with image processing functions. You can take a look at the API.
PHP中文网2017-04-17 15:25:12
Data compression will calculate the pixel size of each image on the final image, then compress 1 billion images to the corresponding size, and finally call ImageMagick for splicing
天蓬老师2017-04-17 15:25:12
I’m not sure about the principle of the thumbnail generation algorithm, or can you see if you can parallelize the algorithm and do it in a distributed way?
ringa_lee2017-04-17 15:25:12
Why is there such a demand? 100,000 such small pictures cannot take up even one pixel in each picture, right?