比如我想做一个表情包,原图大小各异, 需要统一调整成 512x512 的png带透明格式,有没有什么方便的软件 / 工具?
试试这个:洋芋田图像工具箱
也可以用 imagemagick 结合批处理脚本(Windows)或 Shell 脚本(Linux)。以 Windows 为例,操作如下:
- 下载安装 Imagemagick,官网:https://imagemagick.org/,最新版的安装文件可 点击此处 下载。
- 新建一个文件夹,把要处理的图片放进来。
- 在文件夹中新建一个文本文档,并命名为 “convert.bat”,编码设置为 ANSI(必须是 ANSI,不可以是 UTF-8),将下列命令粘贴到该脚本文档中:
@ echo off
for %%i in (*.png) do (
convert -resize 512x512 -background transparent -gravity center -extent 512x512 %%
1 %%1
)
echo done
pause
最后,双击 convert.bat
,待屏幕显示 done
即可关闭命令行窗口。
注意:该脚本会直接覆盖源文件,操作前请做好备份。
试试 caesium-image-compressor,我一直在用这个,涉及图片格式转换、无损有损压缩等等各种批量处理图片的方式,调整图片尺寸已经是里面非常小的一个功能了
我朋友给我写的脚步
jsx格式 要给ps用(但是我的电脑没有装ps)
/*-----------------------------------------------------------------------------
File: square-canvas.jsx
Version: 1.0
Author: Juan Garcia
Language: JavaScript/ExtendScript
-----------------------------------------------------------------------------*/
var inputFolder = Folder.selectDialog("Select a folder");
var fileList = inputFolder.getFiles("*.PNG"); // Define type of file to manipulate
function resizeCanvas () { // Define function
app.preferences.rulerUnits = Units.PIXELS; // Define units if using fixed canvas size e.g. doc.resizeCanvas(48, 48)
for(var i=0; i<fileList.length; i++) {
var img = open(fileList[i]);
if (img.width !== img.height) { // Check if canvas is square
if (img.width > img.height) { // Find largest measurement
img.resizeCanvas(img.width, img.width); // If the width is the largest value, use it for both measurements
}
else {
img.resizeCanvas(img.height, img.height); // If the width is the largest value, use it for both measurements
}
}
img.resizeImage(UnitValue(512,"px"),null,null,ResampleMethod.BICUBICSHARPER);
img.close(SaveOptions.SAVECHANGES); // Close and save before adjusting next file (prevents crashed)
}
}
resizeCanvas();
付费软件: Light Image Resizer
免费选择: XnConvert
ps的自动处理脚本 ,, 录制好步骤,然后批量应用
微软官方开源工具箱 PowerToys 里面就有这个功能,设置添加一下分辨率,然后Encoding 选一下你想要的 png,就可以直接全选图片,右键一键批量调整分辨率了。
为什么要把别人代码的版权信息删了呢?
原作者的DEMO站:Images Tool v3.0
源码:github
这本身就是网上自行部署的老版本,又不是我自己搭建的
我可没你这么清闲,还去搜搜工具作者是谁。
1、只是因为恰好我也自己部署了
2、从1.0版本开始都是带版权信息的,社区版最新就是3.0,不存在老版本就不带的情况。
3、我也没说是你删的版权信息,毕竟也不知道这是你部署的,还是你随手搜的一个站点。
4、违反开源协议的行为是需要谴责的。
基于小众论坛的风格,你要不要考虑改成正确的站呢?
您发,我把评论删了。
IrfanView 4.70 有一个选项允许显示和保存图像的透明区域
vipsthumbnail *jpg --smartcrop attention -s 512 -o tn_%s.png
这是一个命令行转换工具,可以编一个脚本进行批量缩放、裁剪的操作
光影魔术手里的批处理,很方便
大项目 我会用AU3写一个
其他的软件我知道的 有 LR,Co,
要不你试试国际版的这个。看图也不错。https://h1.appinn.me/file/1729267954506_image.png