added documentation for converting to RGBA png type (which is supported)

This commit is contained in:
emilis 2022-11-02 19:11:50 +00:00
parent d4946a29d1
commit 18938dd2a0
4 changed files with 5 additions and 3 deletions

View File

@ -1,3 +1,5 @@
# cowmic
generates memes
`mogrify -define png:format=png32 -format png *.png`

View File

@ -9,7 +9,7 @@ pub struct Template<T: AsRef<str>, V: AsRef<Path>> {
impl<T: AsRef<str>, V: AsRef<Path>> Template<T, V> {
pub fn new(base: Vec<u8>, elements: Vec<Element<T, V>>) -> Result<Self, CowError> {
let base: Image = Image::from_bytes_inferred(base)?;
let base: Image<Dynamic> = Image::from_bytes_inferred(base)?;
Ok(Self {
dimensions: base.dimensions(),
elements,

BIN
cowmic/src/cow2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 KiB

View File

@ -4,7 +4,7 @@ use cowgen::{CowError, Element, Text};
fn main() -> Result<(), CowError> {
let out = cowgen::Template::new(
include_bytes!("cow.png").to_vec(),
include_bytes!("cow2.png").to_vec(),
vec![Element::new(
cowgen::Media::Text(Text::new(
"Hello",