缩小gif图片大小格式图片大小

gif格式图片大小如何缩小_百度知道
gif格式图片大小如何缩小
娘不是图片大小有限制嘛。。,我用Ulead Gif Animator这个工具作图都很大。。怎么办
,这个我晓得。对。.T。可是改了还是很大T。。。有没有什么其他的工具
提问者采纳
就可以了。很简单,最后点导出向导,保存为gif格式的图片,缩放下载一个Fireworks,希望能够帮到你,还可以删减帧数,新建--(设定如500*200的大小),可以任意挪动,导入gif图片
采纳率100%
其他类似问题
为您推荐:
其他2条回答
midnightbreeze@126!
PS;在下拉菜单中有一个“调整图像大小”点中/然后在菜单栏中点“编辑”&#47。不管是JPG(JPEG)格式的静图哥们,还是怎么着。一般的图片处理软件都有改变图片大小功能的,还是JIF格式的动图,减少帧延迟;如不想因调整大小而改变图片比例的话,你就删减不重要的帧,只要点中下面帧面板的第一帧(其实哪一帧都行)&#47,是可以任意改变图片大小的?用Ulead Gif Animator软件作图片:如果还大,我帮你改改也行。别的软件PS和美图秀秀都能调整JIF图片文件大小;在弹出的对话框中有“画布尺寸”“宽度”和“高度”的数值更改输入框&#47。如果方便把图片发到我邮箱,请勾选保“持原样比例”!你是想自制签名档
用PS改,几步就好了
gif格式的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁您还未登陆,请登录后操作!
悬赏20爱心点
分享到微博
请选择登录方式
怎样把3MB多JPEG格式的图片缩小到1.5MB以下?或转换成网络上常用的GIF格式啊?
照了一些照片,想传到网上,可照片全是3MB多的。。。网上上传限制都在1.5MB左右。。。
大家教教小弟我怎么办啊~!~~~~~
降低总像素或加大压缩率可减小文件长度,GIF格式只有256色,不适合照片使用.
你的数码相机像素太高了,降低像素拍摄也是一个办法.
网易相册对图片大小几乎没有限制,改用网易相册试试,这是我的:
See很好用
选中你要压缩的图片,点右键选择convert大概是&转换&的意思(我习惯英文版,网上可以下载到中文的)选择jpg格式,一般默认是压缩成品质65%的,你也可以自己设定压缩多少,选定之后按OK就行啦
可以一下压缩很多图图,很方便
您的举报已经提交成功,我们将尽快处理,谢谢!
大家还关注您还未登陆,请登录后操作!
怎样在保证图片象素大小的情况下尽量缩小图象的空间大小
很容易,你可以用photoshop打开图片,然后点另存为把它保存为.gif格式的.因为这个格式很好,而且占用空间也会比其它的小很多.
图存为JPEG格式.如果是JPEG格式就打开重新保存一下.
只要不是GIF动画
300*300怎么样也不会超过500K的
wangkuangdada
您的举报已经提交成功,我们将尽快处理,谢谢!
大家还关注当前访客身份:游客 [
人心是不待风吹而自落的花.
:我也遇到了 感谢。
:javascript 就可以实现了:http://www.atool.or...
:引用来自“ppt0501”的评论感谢大哥啊,一模一样...
:引用来自“黄衰后生”的评论 引用来自“雪海幽梦...
:引用来自“雪海幽梦”的评论 我照你的方法去做了...
:我照你的方法去做了,文件能下载下来,但大小只有...
:感谢大哥啊,一模一样的问题,解决了!
:感谢大哥啊,一模一样的问题,解决了!
:引用来自“wwwjjj”的评论 特殊要求这个做法没问...
:特殊要求这个做法没问题,考虑到别人接手的难度问...
今日访问:56
昨日访问:97
本周访问:376
本月访问:443
所有访问:24559
图片工具类,完成图片的截取和任意缩放
发表于2年前( 23:44)&&
阅读(473)&|&评论()
0人收藏此文章,
图片工具类,完成图片的截取和任意缩放:
import java.awt.Graphics2D;
import java.awt.I
import java.awt.RenderingH
import java.awt.geom.AffineT
import java.awt.image.BufferedI
import java.awt.image.ColorM
import java.awt.image.WritableR
import java.io.F
import java.io.FileInputS
import java.io.FileOutputS
import java.io.IOE
import java.io.InputS
import javax.imageio.ImageIO;
import mons.logging.L
import mons.logging.LogF
import org.eclipse.swt.graphics.R
import com.gif4j.GifD
import com.gif4j.GifE
import com.gif4j.GifI
import com.gif4j.GifT
import com.sun.image.codec.jpeg.JPEGC
import com.sun.image.codec.jpeg.JPEGImageE
/** 图片工具类,完成图片的截取
* @author Beau Virgill */
public class IamgesResize
private static Log log = LogFactory.getLog(IamgesResize.class);
BufferedImage bufI // 原始图片
// 缩放的宽度
// 缩放的高度
public IamgesResize()
// TODO Auto-generated constructor stub
public IamgesResize(String srcPath, int width, int height)
this.width =
this.height =
this.bufImage = ImageIO.read(new File(srcPath));
catch (Exception e)
e.printStackTrace();
/** 实现图像的等比缩放和缩放后的截取,如果高度的值和宽度一样,则缩放按设置的值缩放 (只控制宽度的大小,高度的值设置不生效(只有高度的值和宽度的一样才生效), 高度自动按比例缩放;如果缩放的图片小于你设置的值则保存原图大小)
* @param inFilePath
要缩放图片文件的路径
* @param outFilePath
缩放后保存图片输出的路径
* @param width
要截取宽度
* @param hight
要截取的高度
* @throws Exception */
public static void zoomOutImage(String inFilePath, String outFilePath, int width, int hight, boolean smooth)
throws Exception
int maxHight = 500; // 设置最大的图片高度;
File file = new File(inFilePath);
InputStream in = new FileInputStream(file);
File saveFile = new File(outFilePath);
BufferedImage srcImage = ImageIO.read(in);
String gif = inFilePath.substring(inFilePath.lastIndexOf(".") + 1, inFilePath.length());
if ((gif.equals("gif") || gif.equals("GIF")) && smooth == true) // gif动态图片的处理
IamgesResize.getGifImage(inFilePath, outFilePath, width, hight, true);
// 如果宽度和高度一样 或者图片的规格为 images_120 时不按等比缩放,如果需要等比缩放, 则将下面的 if 语句注释即可
if (width != hight && !outFilePath.contains("images_120"))
double sx = (double) width / srcImage.getWidth();
hight = (int) (srcImage.getHeight() * sx);
("原理图片路径------&" + inFilePath);
("保存图片新路径------&" + saveFile);
if (width & 0 || hight & 0)
// 原图的大小
int sw = srcImage.getWidth();
int sh = srcImage.getHeight();
("原图宽=" + sw);
("原图高=" + sh);
// 如果原图像的大小小于要缩放的图像大小,直接将要缩放的图像复制过去
if (sw & width && sh & hight)
srcImage = rize(srcImage, width, hight);
("原图片的大小小于要缩放的大小,不需要缩小");
String fileName = saveFile.getName();
String formatName = fileName.substring(fileName.lastIndexOf('.') + 1);
ImageIO.write(srcImage, formatName, saveFile);
// 缩放后的图像的宽和高
int w = srcImage.getWidth();
int h = srcImage.getHeight();
("缩小图片宽度= " + w);
("缩小图片高度= " + h);
// 如果缩放后的图像和要求的图像宽度一样,就对缩放的图像的高度进行截取
if (w == width)
// 计算 X轴坐标
int x = 0;
// 如果图片超过指定高度则截取一定的高度
if (h &= maxHight && width != 600) // 图片为600 的不需要截取高度
int y = h / 2 - hight / 2;
saveSubImage(srcImage, new Rectangle(x, y, width, maxHight), saveFile);
int y = h / 2 - hight / 2;
saveSubImage(srcImage, new Rectangle(x, y, width, hight), saveFile);
// 否则如果是缩放后的图像的高度和要求的图像高度一样,就对缩放后的图像的宽度进行截取
else if (h == hight)
// 计算X轴坐标
int x = w / 2 - width / 2;
int y = 0;
saveSubImage(srcImage, new Rectangle(x, y, width, hight), saveFile);
in.close();
/** @param srcPath
图片的绝对路径
* @param width
图片要缩放的宽度
* @param height
图片要缩放的高度
* @param rizeType
图片要缩放的类型(1:宽度固定,高度自动 2:按宽度和高度比例缩小)
* @return */
public static BufferedImage rize(BufferedImage srcBufImage, int width, int height)
BufferedImage bufTarget =
int type = srcBufImage.getType();
double sx = (double) width / srcBufImage.getWidth();
double sy = (double) height / srcBufImage.getHeight();
("w=" + sx);
("h=" + sx);
if (type == BufferedImage.TYPE_CUSTOM)
ColorModel cm = srcBufImage.getColorModel();
WritableRaster raster = cm.createCompatibleWritableRaster(width, height);
boolean alphaPremultiplied = cm.isAlphaPremultiplied();
bufTarget = new BufferedImage(cm, raster, alphaPremultiplied, null);
bufTarget = new BufferedImage(width, height, type);
Graphics2D g = bufTarget.createGraphics();
g.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
g.drawRenderedImage(srcBufImage, AffineTransform.getScaleInstance(sx, sy));
g.dispose();
return bufT
/** 实现缩放后的截图
* @param image
缩放后的图像
* @param subImageBounds
要截取的子图的范围
* @param subImageFile
要保存的文件
* @throws IOException */
private static void saveSubImage(BufferedImage image, Rectangle subImageBounds, File subImageFile)
throws IOException
if (subImageBounds.x & 0 || subImageBounds.y & 0 || subImageBounds.width - subImageBounds.x & image.getWidth()
|| subImageBounds.height - subImageBounds.y & image.getHeight())
BufferedImage subImage = image.getSubimage(subImageBounds.x, subImageBounds.y, subImageBounds.width,
subImageBounds.height);
String fileName = subImageFile.getName();
String formatName = fileName.substring(fileName.lastIndexOf('.') + 1);
ImageIO.write(subImage, formatName, subImageFile);
/** 针对书签截屏的等比缩放(等比缩放,不失真)
* @param src
源图片文件完整路径
* @param dist
目标图片文件完整路径
* @param width
缩放的宽度
* @param heightw
缩放的高度 */
public static void createThumbnail(String src, String dist, float width, float height)
File srcfile = new File(src);
if (!srcfile.exists())
log.error("文件不存在");
BufferedImage image = ImageIO.read(srcfile);
// 获得缩放的比例
double ratio = 1.0;
// 判断如果高、宽都不大于设定值,则不处理
if (image.getHeight() & height || image.getWidth() & width)
if (image.getHeight() & image.getWidth())
ratio = height / image.getHeight();
ratio = width / image.getWidth();
// 计算新的图面宽度和高度
int newWidth = (int) (image.getWidth() * ratio);
int newHeight = (int) (image.getHeight() * ratio);
BufferedImage bfImage = new BufferedImage(newWidth, newHeight, BufferedImage.TYPE_INT_RGB);
bfImage.getGraphics().drawImage(image.getScaledInstance(newWidth, newHeight, Image.SCALE_SMOOTH), 0, 0,
FileOutputStream os = new FileOutputStream(dist);
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(os);
encoder.encode(bfImage);
os.close();
("创建缩略图成功");
catch (Exception e)
log.error("创建缩略图发生异常" + e.getMessage());
/** 实现图像的等比缩放和缩放后的截取,如果高度的值和宽度一样,则缩放按设置的值缩放 (只控制宽度的大小,高度的值设置不生效(只有高度的值和宽度的一样才生效), 高度自动按比例缩放;如果缩放的图片小于你设置的值则保存原图大小)
* 如果要缩放的宽度和高度相等则不按比例缩放;直接缩小图片
* @param filepath
要缩放图片文件的路径
* @param saveFilePath
缩放后保存图片输出的路径
* @param imgWidth
要缩放的宽度
* @param imHeight
要缩放的高度
* @throws Exception */
public static boolean readPicfile(String filepath, String saveFilePath, int imgWidth, int imHeight)
throws Exception
File file = new File(filepath);
if (file.isDirectory())
{ // 如果path表示的是否是文件夹,是返回true
("文件夹");
String[] filelist = file.list();
("总图片个数=" + filelist.length);
int count = 0;
for (int i = 0; i & filelist. i++)
File readfile = new File(filepath + filelist[i]);
if (!readfile.isDirectory())
("absolutepath=" + readfile.getAbsolutePath());
("imgName=" + readfile.getName());
String imgfuffix = readfile.getName().substring(readfile.getName().lastIndexOf(".") + 1,
readfile.getName().length()); // 获取文件的后缀
// 是图片类型的才执行缩放
if (isFromImgUrl(imgfuffix))
IamgesResize.zoomOutImage(filepath + readfile.getName(), saveFilePath + readfile.getName(),
imgWidth, imHeight, true);
IamgesResize.createThumbnail(filepath + readfile.getName(), saveFilePath + readfile.getName(),
imgWidth, imHeight);
/** gif图片缩放有动态效果
* @param srcImg
* @param destImg
要保存的文件
* @param width
* @param height
* @param smooth
* @throws Exception */
public static void getGifImage(String srcImg, String destImg, int width, int hight, boolean smooth)
throws Exception
File file = new File(srcImg);
File saveFile = new File(destImg);
InputStream in = new FileInputStream(srcImg);
BufferedImage srcImage = ImageIO.read(in);
GifImage gifImage = GifDecoder.decode(file);// 创建一个GifImage对象.
if (width & 0 || hight & 0)
// 原图的大小
int sw = srcImage.getWidth();
int sh = srcImage.getHeight();
if (width == hight)
else if (sw & width)
double sx = (double) width / srcImage.getWidth();
hight = (int) (srcImage.getHeight() * sx);
// 1.缩放重新更改大小.
GifImage resizeIMG = GifTransformer.resize(gifImage, width, hight, true);
// 2.剪切图片演示.
// Rectangle rect = new Rectangle(0,0,200,200);
// GifImage cropIMG = GifTransformer.crop(gifImage, rect);
// 3.按比例缩放
// GifImage resizeIMG = GifTransformer.scale(gifImage, 1.0, 1.0,true);//参数需要double型
// 4.其他的方法.还有很多,比如水平翻转,垂直翻转 等等.都是GifTransformer类里面的.
GifEncoder.encode(resizeIMG, saveFile);
catch (IOException e)
e.printStackTrace();
log.debug("保存失败(该图为修改过得gif图片),重新保存一次。");
IamgesResize.zoomOutImage(srcImg, destImg, width, hight, false);
/** 判断网址是不是图片类型。
* @param fromUrl
* @return */
public static boolean isFromImgUrl(String imgfuffix)
boolean isImage =
// 支持的图片后缀。
String[] imgSuffixs = { "jpg", "JPG", "jpeg", "JPEG", "gif", "GIF", "png", "PNG", "bmp", "BMP" };
for (int i = 0; i & imgSuffixs. i++)
if (imgfuffix.equals(imgSuffixs[i]))
return isI
1)">1)">1" ng-class="{current:{{currentPage==page}}}" ng-repeat="page in pages"><li class='page' ng-if="(endIndex<li class='page next' ng-if="(currentPage
相关文章阅读

我要回帖

更多关于 怎么缩小gif图片大小 的文章

 

随机推荐