Releases: W-Mai/icu
Release list
v0.1.7
Big Update
- ❤️ Support converting image from a folder to another folder an keep sub folder file structures now!
- 🐛 Some bug fix
Examples
Convert an common image format to an common image format
if you want to converting images with logs out put, you can use -vv option.
$ icu -vv convert res/img_0.png res/img_0.jpeg --output-format webp`
[2024-02-29T13:05:06Z INFO icu] Start converting files
[2024-02-29T13:05:06Z INFO icu]
[2024-02-29T13:05:06Z INFO icu] took 0.002740s for converting [res/img_0.png] to [res/img_0.webp] with format [WEBP]
[2024-02-29T13:05:06Z INFO icu] took 0.002257s for converting [res/img_0.jpeg] to [res/img_0.webp] with format [WEBP]
[2024-02-29T13:05:06Z INFO icu]
[2024-02-29T13:05:06Z INFO icu] Total converting time:
[2024-02-29T13:05:06Z INFO icu] Consuming : 0.005121s for 2 files
[2024-02-29T13:05:06Z INFO icu] User time: 0.004998s
[2024-02-29T13:05:06Z INFO icu] System time: 0.000123sor in a short form:
$ icu -vv convert res/img_0.png res/img_0.jpeg -F webpConvert some images in a folder to another specific folder
convert all images in the res folder to jpeg format and save them in the res/output folder, if the output file
already exists, it will override it (you should use -r --override-output option).
if and the output folder will keep the same structure as the input folder.
$ icu convert res -O res/output --output-format jpeg --override-outputor in a short form:
$ icu convert res -O res/output -F jpeg -rConvert an LVGL image format to an common image format
Convert an LVGL image format to an common image format.
And if you specify the --overide-output option, ICU will override the output file if it already exists.
And you will get a warning message for sure if the output file already exists.
$ icu -vv convert res/img_0.bin -O res/output -F jpeg -r
[2024-03-03T16:08:01Z INFO icu] Start converting file
[2024-03-03T16:08:01Z INFO icu]
[2024-03-03T16:08:01Z WARN icu] Override output file <res/output/img_0.jpeg> for converting <res/img_0.bin>
[2024-03-03T16:08:01Z INFO icu] took 0.007022s for converting <res/img_0.bin> to <res/output/img_0.jpeg> with format <JPEG>
[2024-03-03T16:08:01Z INFO icu]
[2024-03-03T16:08:01Z INFO icu] Total converting time:
[2024-03-03T16:08:01Z INFO icu] Consuming : 0.008715s for 1 files
[2024-03-03T16:08:01Z INFO icu] User time: 0.007022s
[2024-03-03T16:08:01Z INFO icu] System time: 0.001693s
Convert an common image format to an LVGL image format
Convert an common image format to an LVGL image format, you need to specify the output color format and lvgl version.
But if you don't specify the lvgl version, ICU will use the default version (v9).
$ icu convert res/img_0.png -O res/output -F lvgl -C i8 -rConvert an common image format to an LVGL image format with stride align
Convert an common image format to an LVGL image format with stride align, you need to specify the output color format,
lvgl version, and stride align (default is 1).
4 means the stride of the output image will be 4 bytes aligned.
$ icu convert res/img_0.png -O res/output -F lvgl -C i8 -S 4 -rFull Changelog: v0.1.5...v0.1.7 with ❤️
v0.1.5
Big Updating
- Add
can_decodeinterface forEnDecoderinicu_lib - Support auto detect image format for input image files
- Simplify argument inputs
Easy to install
cargo install icu_toolFull Changelog: v0.1.4...v0.1.5 with ❤️
v0.1.4
Big Updating
- 🚧 Refactor
icuinput args - 🚧 Refactor
icu_libconversion structure - 📄 Support conversion time log
- with option
-vvlikeicu -vv convert res/img_0.png res/img_0.jpeg --output-format webp
- with option
peace&love ❤️
Full Changelog: v0.1.3...v0.1.4
v0.1.3
- add color picker support
Full Changelog: v0.1.1...v0.1.3
v0.1.1
Support Render Image in a preview window
icu xxxxEasy to install
cargo install icu_tool
Full Changelog: v0.1.0...v0.1.1
First Release
ICU
Image Converter Ultra
Introduction
The Image Converter Ultra (ICU) is a software that converts images from one format to another. It is designed to be a
versatile tool that can handle a wide range of image formats and convert them to other formats. The ICU is designed to
be a standalone application that can be used on any platform that supports the necessary dependencies. The ICU is
written in RUST.
Features
- Supports a wide range of image formats
- Supports LVGL binary format
How to use
use icu_lib::endecoder::{common, lvgl_v9};
use icu_lib::midata::MiData;
use icu_lib::EncoderParams;
use std::fs;
fn main() {
const DATA: &[u8] = include_bytes!("../res/img_0.png");
// Decode the image data and automatically detect the format
let mid = MiData::decode_from::<common::AutoDectect>(Vec::from(DATA));
// Encode the image data to the LVGL binary format with ARGB8888 color format
let data = mid.encode_into::<lvgl_v9::ColorFormatARGB8888>(
EncoderParams {
stride_align: 256,
dither: false,
});
fs::write("img_0.bin", data).expect("Unable to write file");
}What's Changed
- 🐛(lvgl_v9): fix IA1/2/4/8 color convert minor color error problem by @W-Mai in #1
- ✨(lvgl_v9): performance improvement and optimization by @W-Mai in #2
New Contributors
Full Changelog: https://github.com/W-Mai/icu/commits/v0.1.0