将jpeg或bmp转换为pgm格式 [英] convert jpeg or bmp to pgm format

查看:807
本文介绍了将jpeg或bmp转换为pgm格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用.net代码将图像从jpeg转换为pgm ...请帮助

i need to convert the images to be stored in a folder from jpeg to pgm using .net code... please help

推荐答案

用于处理PNG文件的标准Image类;我知道没有任何东西可以处理转换 - 因为JPG是全彩色的,而PGM是灰度级的,所以我并不感到惊讶。鉴于这是一种未压缩的,非常基本的文件格式,我对普遍缺乏支持并不感到惊讶。



很可能,你必须自己编写。

这两个链接应该有所帮助: PGM文件规范 [ ^ ]

阅读 - 用C#(C Sharp)编写PGM(便携式图形媒体)图像文件 [ ^ ]

但是不要指望C#代码是一个完整的解决方案:它绝对不是!你非常喜欢这个......
There is nothing in the standard Image class to handle PNG files; and I know of nothing that can handle the conversion - since JPG are full colour and PGM are greyscale, that doesn''t surprise me. And given that is is an uncompressed, very basic file format, I am not surprised by the general lack of support.

So probably, you will have to write your own.
These two links should help: PGM File specification[^]
Reading-Writing PGM(Portable Graphics Media) Image Files With C#(C Sharp)[^]
But do not expect the C# code to be a complete solution: it very definitely isn''t! You are very much on your own with this one...


这篇关于将jpeg或bmp转换为pgm格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆