我需要将8位IplImage转换为32位IplImage.使用来自整个网络的文档,我尝试了以下方法:
// general code
img2 = cvCreateImage(cvSize(img->width, img->height), 32, 3);
int height = img->height;
int width = img->width;
int channels = img->nChannels;
int step1 = img->widthStep;
int step2 = img2->widthStep;
int depth1 = img->depth;
int depth2 = img2->depth;
uchar *data1 = (uchar *)img->imageData;
uchar *data2 = (uchar *)img2->imageData;
for(h=0;h<height;h++) for(w=0;w<width;w++) for(c=0;c<channels;c++) {
// attempt code...
}
// attempt one
// result: white image, two red spots which appear in the original image too.
// this is the closest result, what's …
Run Code Online (Sandbox Code Playgroud) 我可以从 CLI 执行什么命令或一系列命令来递归遍历目录树并将该树中所有 PNG 文件的位深度从 24bpp 减少到 16bpp?命令应该保留 alpha 层并且不应该增加 PNG 的文件大小 - 事实上减少会更可取。
我有一个基于 OSX 的系统可供我使用,并且熟悉该find
命令,因此我真的更想找到合适的 PNG 实用程序命令。