画图和JPEG文件 [英] Paint and JPEG files

查看:84
本文介绍了画图和JPEG文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
我对.NET中的图像处理有疑问.可能有点奇怪.我时常从相机中拍摄图像,这些图像的大小可笑为5MB或更大.我发现在Paint中打开它们,然后将它们保存为JPEG(再次)将大小减小到可以管理的程度.当我必须为很多图像(数百个)执行此操作时,这有点乏味,因此我想编写一个应用程序来执行此操作.

我希望您可以提供任何参考链接,这些链接可以指导我理解创建此应用程序的逻辑.是否可以编写此应用程序使用Paint将现有的JPEG文件保存为新的JPEG文件?

我希望在那里有意义.

Hello,
I have a doubt regarding image processing in .NET. Probably a little weird. I have images taken from my camera from time to time which are given ridiculous sizes of 5MB or more. I find that opening them in Paint and then saving them to a JPEG (once again) reduces the size to a manageable one. This is a little tedious when I have to do this for probably a lot of images (hundreds) so I want to write an app to do this.

I would like any reference links you can provide which can guide me to understand the logic of creating this app. Is it possible to write this app which sort of uses Paint to save an existing JPEG file to a new JPEG file?

I hope I made sense there. Thanks!

推荐答案

有很多现成的实用程序和库,例如开源和多平台ImageMagic.请参阅:
http://en.wikipedia.org/wiki/ImageMagick [ http://www.imagemagick.org/ [ ^ ].

随命令行实用程序一起提供,您可以轻松地编写一个或两行的批处理文件,其顺序如下:在工作目录中转换所有文件",或在指定目录中相同,或在工作目录中相同,并且全部子目录,递归地,是来自指定文件列表"的子目录,或类似的东西.

对于高级用户(甚至不是软件开发人员)来说,编写批处理文件的必备功能是基本的.您可以在任何基本手册中进行阅读.

编写自己的C#代码也很容易:
http://stackoverflow.com/questions/41665/bmp-to-jpg- png-in-c-sharp [ ^ ].

—SA
There are enough of ready-to-use utilities and libraries, such as Open Source and multi-platform ImageMagic. Please see:
http://en.wikipedia.org/wiki/ImageMagick[^],
http://www.imagemagick.org/[^].

As it comes with command-line utilities, you can easy write a batch file of one or two lines, ordering something like: "convert all files in working directory", or the same in specified directory, or the same in working directory and all sub-directories, recursively, of "from the specified file list", or anything like that.

The required ability to write batch files is rudimentary for an advanced user, not even a software developer, you can read about it in any elementary manual.

Writing your own C# code is also pretty easy:
http://stackoverflow.com/questions/41665/bmp-to-jpg-png-in-c-sharp[^].

—SA


这篇关于画图和JPEG文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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