㈠ 怎么压缩图片的大小
用这个在线图片压缩工具,想把图片文件的大小减到多少都行,比如你直接设置一下压缩数值到600kb,马上瞬间就能把图片的文件大小压缩到600kb搞定,你设定压缩到多少kb,他压缩完输出的图片就是多少kb,方便得很。在线智能压缩图片大小,图片压缩体积
在线图片智能压缩使用步骤:
一、首先点击加号添加需要压缩的图片。目前已知支持对jpg、png等多种常见的图片格式进行压缩,如果上传图片并压缩成功,则代表支持该图片格式。
二、可以自行修改图片需要被压缩到的最大宽高尺寸,默认为图片原始的宽高尺寸,且宽高比例是自动锁定的。
三、必须设置图片被压缩后,期望输出的图片文件的最大占用空间。(必填项)
四、选择图片生成的算法。默认为混合优先算法,绝大多数情况下使用默认算法即可。
五、压缩的设定值不能小于1Kb,但图片压缩的最终效果可以小于1Kb。
butterpig
㈡ 如何压缩图片大小
我们可以借助软件进行图片大小的压缩,这里介绍利用美图秀秀进行压缩:
1、首先打开美图秀秀软件,然后点击右上角的打开按钮,打开需要更改的图片。
㈢ 怎样把图片缩小
这个很容易实现啊,比如用这个在线图片压缩工具,想把图片文件的大小减到多少都行,直接设置一下数值,马上瞬间就能完成了。在线智能压缩图片大小,图片降低像素,PNG|JPG大图缩小
▼ 在线一键压缩图片步骤:
一、首先点击加号添加需要压缩的图片。目前已知支持对jpg、png等多种常见的图片格式进行压缩,如果上传图片并压缩成功,则代表支持该图片格式。
二、可以自行修改图片需要被压缩到的最大宽高尺寸,默认为图片原始的宽高尺寸,且宽高比例是自动锁定的。
三、必须设置图片被压缩后,期望输出的图片文件的最大占用空间。(必填项)
四、选择图片生成的算法。默认为混合优先算法,绝大多数情况下使用默认算法即可。
五、压缩的设定值不能小于1Kb,但图片压缩的最终效果可以小于1Kb。
㈣ 如何用c语言实现压缩图片内存大小
是(row,col,value),这样把所有不为零的值组成一个向量。这种存储方式比二维数组节省了不少空间,当然还可以进一步节省,因为三元组里面row或者col重复存储了,一行或者一列存一次就行了,按这种思路走下去就是行压缩存储了。
那具体什么是行压缩存储呢?行压缩存储的思想就是,把所有不为零的值按行访问的顺序组成一个向量,然后再把每一行值不为0的列的下标存下来,这个两个向量的大小和稀疏矩阵中不为0的值得个数相同,当然要实现对行压缩矩阵的访问,还要把每一行的不为0的列的下标在第二个向量中开始的位置存下来,有人把这个叫做指针。有了这三个向量就可以实现对矩阵实现高效的按行访问了。行压缩存储比三元组优秀的不仅是空间的压缩,还有就是行访问时的高效。三元组如果是有序的,可以二分查找来访问一行,但是行压缩存储按行访问时的时间复杂度是常数级的。 大家可以参考下面这个行压缩矩阵示意图:
㈤ C# 求将较大的JPG图片按比例缩小到宽500的大小图片的代码
/// <summary>
/// 图片等比缩放
/// </summary>
/// <param name="postedfile">原图</param>
/// <param name="savepath">缩略图存放地址</param>
/// <param name="targetwidth">指定的最大宽度</param>
/// <param name="targetheight">指定的最大高度</param>
public static void zoomauto(string initpath,string savepath, double targetwidth, double targetheight)
{
//创建目录
string dir = Path.GetDirectoryName(savepath);
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
//原始图片(获取原始图片创建对象,并使用流中嵌入的颜色管理信息)
Image initimage = Image.FromFile(initpath);
//原图宽高均小于模版,不作处理,直接保存
if (initimage.Width <= targetwidth && initimage.Height <= targetheight)
{
//保存
initimage.Save(savepath, System.Drawing.Imaging.ImageFormat.Jpeg);
}
else
{
//缩略图宽、高计算
double newwidth = initimage.Width;
double newheight = initimage.Height;
//宽大于高或宽等于高(横图或正方)
if (initimage.Width > initimage.Height || initimage.Width == initimage.Height)
{
//如果宽大于模版
if (initimage.Width > targetwidth)
{
//宽按模版,高按比例缩放
newwidth = targetwidth;
newheight = initimage.Height * (targetwidth / initimage.Width);
}
}
//高大于宽(竖图)
else
{
//如果高大于模版
if (initimage.Height > targetheight)
{
//高按模版,宽按比例缩放
newheight = targetheight;
newwidth = initimage.Width * (targetheight / initimage.Height);
}
}
//生成新图
//新建一个bmp图片
Image newimage = new Bitmap((int)newwidth, (int)newheight);
//新建一个画板
Graphics newg = Graphics.FromImage(newimage);
//设置质量
newg.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
newg.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
//置背景色
newg.Clear(Color.White);
//画图
newg.DrawImage(initimage, new Rectangle(0, 0, newimage.Width, newimage.Height), new Rectangle(0, 0, initimage.Width, initimage.Height), GraphicsUnit.Pixel);
//保存缩略图
newimage.Save(savepath+"123.jpeg", System.Drawing.Imaging.ImageFormat.Jpeg);
//释放资源
newg.Dispose();
newimage.Dispose();
initimage.Dispose();
}
}
调用
ptimage ptimage = new ptimage();
ptimage.zoomauto(@"C:\", @"D:\", 500, 200);
两个路径自己指定 第一个是图片路径,带文件名和扩展名,第二个是存储路径到文件夹
其他的看注释吧
㈥ 如何压缩大量照片
照片很多的话,压缩的时候肯定希望能压缩的快、节省时间,这里推荐一款在线照片压缩工具:压缩图网站的批量云端压缩功能,一次最多压缩60张图片
1、点击批量云端压缩,批量云端压缩一次最多能够60张图片同时处理。
批量云端压缩功能
㈦ c# 打印里图片这么让png的高清大图按比例缩小,
// <summary>
/// 生成缩略图
/// </summary>
/// <param name="originalImagePath">源图路径(物理路径)</param>
/// <param name="thumbnailPath">缩略图路径(物理路径)</param>
/// <param name="width">缩略图宽度</param>
/// <param name="height">缩略图高度</param>
/// <param name="mode">生成缩略图的方式</param>
public static void MakeThumbnail(string originalImagePath, string thumbnailPath, int width, int height, string mode)
{
System.Drawing.Image originalImage = System.Drawing.Image.FromFile(originalImagePath);
int towidth = width;
int toheight = height;
int x = 0;
int y = 0;
int ow = originalImage.Width;
int oh = originalImage.Height;
switch (mode)
{
case "HW": //指定高宽缩放(可能变形)
break;
case "W": //指定宽,高按比例
toheight = originalImage.Height * width / originalImage.Width;
break;
case "H": //指定高,宽按比例
towidth = originalImage.Width * height / originalImage.Height;
break;
case "Cut": //指定高宽裁减(不变形)
if ((double)originalImage.Width / (double)originalImage.Height > (double)towidth / (double)toheight)
{
oh = originalImage.Height;
ow = originalImage.Height * towidth / toheight;
y = 0;
x = (originalImage.Width - ow) / 2;
}
else
{
ow = originalImage.Width;
oh = originalImage.Width * height / towidth;
x = 0;
y = (originalImage.Height - oh) / 2;
}
break;
default:
break;
}
//新建一个bmp图片
System.Drawing.Image bitmap = new System.Drawing.Bitmap(towidth, toheight);
//新建一个画板
System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(bitmap);
//设置高质量插值法
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High;
//设置高质量,低速度呈现平滑程度
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
//清空画布并以透明背景色填充
g.Clear(System.Drawing.Color.Transparent);
//在指定位置并且按指定大小绘制原图片的指定部分
g.DrawImage(originalImage, new System.Drawing.Rectangle(0, 0, towidth, toheight), new System.Drawing.Rectangle(x, y, ow, oh), System.Drawing.GraphicsUnit.Pixel);
try
{
//以jpg格式保存缩略图
bitmap.Save(thumbnailPath, System.Drawing.Imaging.ImageFormat.Jpeg);
}
catch (System.Exception e)
{
throw e;
}
finally
{
originalImage.Dispose();
bitmap.Dispose();
g.Dispose();
}
}
㈧ 怎样把照片原比例缩小,缩小成一寸照
可以方法如下:
1、在PS中打开素材图片;
2、图像——图像大小——更改“像素大小”或“文档大小”;
3、大照片调整为小照片不失真方法:
打开图片——图像大小——关闭重定像素——提高分辩率;重新启用重定像素及约束比例和缩放样式——确定 。
4、小照片调整为大照片不失真方法:
打开图片——图像大小——确认打开重定像素——在文档大小区域中将单位改成百分比——更改宽、高——确定。
1寸 文档大小 2.5*3.5cm 像素 413*295