简体   繁体   English

如何从 .TIFF 文件存储数据,然后用我的 C 程序修改它

[英]How to store data from a .TIFF file to then modify it with my C program

I know few about this and i'm trying to keep building upon it.我对此知之甚少,我正在努力继续建立它。 My goal is to do image stacking with some criteria using C language, as i came upon some cool ideas i think i should be capable of doing with my photos.我的目标是使用 C 语言根据一些标准进行图像堆叠,因为我想到了一些很酷的想法,我认为我应该能够处理我的照片。 My C background should be enough to understand what i may need.我的 C 背景应该足以了解我可能需要什么。 That being said...话虽如此...

So far i've learned how to read an existing.TIFF file and save it into a char array.到目前为止,我已经学会了如何读取现有的 .TIFF 文件并将其保存到 char 数组中。 The problem is i don't know in which way its data is contained so that i can then be able to analize individual pixels and modify them, or build another.TIFF file from data i previously read.问题是我不知道它的数据以何种方式包含,这样我就可以分析单个像素并修改它们,或者从我之前读取的数据构建另一个 .TIFF 文件。 I've read some things about (a so called) libtiff.h which may be usefull but i can't find where to get it, neither how to install it.我已经阅读了一些关于(所谓的)libtiff.h 的内容,这些内容可能很有用,但我找不到从哪里获得它,也找不到如何安装它。

Does anyone know how a.TIFF file data is stored so that i can read it and apply changes to it?有谁知道 a.TIFF 文件数据是如何存储的,以便我可以读取它并对其应用更改?

Also, Does anyone have any experience with handling image files and editing in C?另外,有没有人有处理图像文件和编辑 C 的经验? Where did you learn it from?你从哪里学来的? Do you know of any place i could search for information/tutorials?你知道我可以搜索信息/教程的任何地方吗?

Any help will be very usefull, Thanks in advance.任何帮助都会非常有用,在此先感谢。

You can do an enormous amount of very sophisticated processing on TIFFs, or any one of 190+ other formats with ImageMagick without any need to understand TIFF format or write any C. Try searching on Stack Overflow for [imagemagick]您可以使用ImageMagick对 TIFF 或 190 多种其他格式中的任何一种进行大量非常复杂的处理,而无需了解 TIFF 格式或编写任何 C。尝试在 Stack Overflow 上搜索[imagemagick]

If you want to do processing yourself, consider https://cimg.eu如果您想自己处理,请考虑https://cimg.eu

Another option might be to convert your TIFFs to NetPBM which is much, much simpler to read and write in C. That would be as follows with ImageMagick :另一种选择可能是将您的 TIFF 转换为NetPBM ,这在 C 中读写起来要简单得多。 ImageMagick如下所示:

magick INPUT.TIFF -compress none OUTPUT.PPM

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM