java - 缩放大图像的最佳方法
问题描述
是否有最好的工具来为 android 工作室缩放多个图像。我已经尝试过 Android Drawable 导入器和其他各种工具,但我不断收到内存不足错误
我正在 Adobe illustrator 中制作图像
结果表格 Adobe Illustrator 缩放后
for l-dpi
810 x 1440
for m-dpi
1080 x 1920
for h-dpi
1620 x 2880
for xhdpi
2160 x3840
for xxhdpi
3240 x 5760
for xxxhdpi
4320 x 7680
我在项目中使用但直到 outOfMemoryException 的图像像素:
for l-dpi
151 x 270 (seven images that have these dimensions)
191 x 284 (other seven images that have these dimensions)
for m-dpi
202 x 360
255 x 379
for hdpi
303 x 540
382 x 569
xhdpi
405 x 720
510 x 759
xxhdpi
607 x 1080
765 x 1139
xxxhdpi
810 x 1440
1020 x 1519
我的项目包含大量图像,因此任何简单的方法都可以在大规模上正确缩放
解决方案
除了减小大小之外,您显然还应该尝试将它们的位深度精确地减小到 8 位。默认情况下,全彩是 32 位,是 4 倍大。
推荐阅读
- mysql - 如何将查询结果更改为 MYSQL 中的另一个值?
- continuous-integration - CI 如何影响语义版本控制?
- javascript - 如何在不同的地方使用密码生成器创建的相同字符串?
- javascript - 放大 D3 v5 后限制轴移动
- javascript - ReactJs 调用 {this.functionName} 和 {this.functionName()} 有什么区别
- mysql - Mysql意外崩溃并停止
- php - 如何在 PHP Codeigniter 中重写 URL
- html - Spinner false 不反映在模板上
- android - 键入每个字母后的 Android Studio 索引
- reactjs - 更改路线时反应导航可以更新位置吗?