缩小图像的尺寸 [英] reduce the size of an image

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

问题描述

你好,
我想将图像插入到mysql数据库中,但是我尝试了一些图像,但是小于100kb的图像正在插入,而另一个图像不是insertig,所以任何机构都可以从摆脱这个问题中获得帮助...... plz任何机构都可以在jsp中发送上述plzzzzzzzzzz

解决方案

压缩. JPEG是有损的.如果您的图像已经使用有损压缩进行了压缩,则可以以降低图像质量为代价来提高压缩系数.在中等程度的较低质量下,您可能不会注意到任何缺陷,但是对压缩的进一步改进"将使图像变得非常难看.


重要的! 从不编辑压缩图像!这样,即使有几次保存操作会累积缺陷,您也可以降低图像质量,甚至无需增加压缩系数.保留未压缩的图像,或者更好地使用无损压缩的图像,并始终从此未受损的样本开始转换为JPEG或有损PNG.


此处的代码无关紧要.您可以有一个图像压缩代码,但这可能是一项很大的工作.

-SA


如果您尝试将图像直接保存到db中,请使用blob作为插入图像的数据类型. /blockquote>

hello,
I want to an insert image onto mysql database and i tried but some images that are less than 100kb are inserting and another are are not insertig so can any body help from getriding from this problem...........plz can any body send the code in jsp for the above plzzzzzzzzzz

解决方案

You can reduce the size of the image by compressing it using some lostless or lossy algorithm of compression. JPEG is lossy, for example. If your image is already compressed using lossy compression, you can improve compression factor at the expense of lower image quality. At moderate degrees of lower quality you might not notice any defects, but further "improvements" of compression will make an image really ugly.


Important! Never edit compressed image! By doing it, you can degrade image even without increase in the compression factor, just because of several save operations accumulating defects. Keep uncompressed image, or, better, an image using lostless compression and always start conversion to JPEG or lossy PNG from this non-compromised sample.


[EDIT] Code is irrelevant here. You can have an image compression code, but this can be quite a big work.

—SA


use blob as a datatype for inserting image if you are trying to save image direct into db


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

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