{"id":32701242,"url":"https://github.com/pulseclient-ddnet/tee-morphosis","last_synced_at":"2025-11-04T01:01:44.647Z","repository":{"id":321293097,"uuid":"1084791457","full_name":"PulseClient-ddnet/tee-morphosis","owner":"PulseClient-ddnet","description":"Lib for parsing, splitting and building tee","archived":false,"fork":false,"pushed_at":"2025-10-28T21:54:04.000Z","size":44,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-28T22:34:04.620Z","etag":null,"topics":["ddnet","processing","skin","tee","uv"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/tee_morphosis","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PulseClient-ddnet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-28T06:56:10.000Z","updated_at":"2025-10-28T21:54:07.000Z","dependencies_parsed_at":"2025-10-28T22:34:06.514Z","dependency_job_id":"1b15fe50-69aa-4384-999d-7bc398fc28aa","html_url":"https://github.com/PulseClient-ddnet/tee-morphosis","commit_stats":null,"previous_names":["pulseclient-ddnet/tee-morphosis"],"tags_count":null,"template":false,"template_full_name":"TOwInOK/rust-template-default","purl":"pkg:github/PulseClient-ddnet/tee-morphosis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PulseClient-ddnet%2Ftee-morphosis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PulseClient-ddnet%2Ftee-morphosis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PulseClient-ddnet%2Ftee-morphosis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PulseClient-ddnet%2Ftee-morphosis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PulseClient-ddnet","download_url":"https://codeload.github.com/PulseClient-ddnet/tee-morphosis/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PulseClient-ddnet%2Ftee-morphosis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":282555242,"owners_count":26688883,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-03T02:00:05.676Z","response_time":108,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ddnet","processing","skin","tee","uv"],"created_at":"2025-11-01T23:01:35.947Z","updated_at":"2025-11-04T01:01:44.584Z","avatar_url":"https://github.com/PulseClient-ddnet.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tee_morphosis\n\n[![Crates.io](https://img.shields.io/crates/v/tee_morphosis.svg)](https://crates.io/crates/tee_morphosis)\n[![Docs.rs](https://docs.rs/tee_morphosis/badge.svg)](https://docs.rs/tee_morphosis)\n\nA library for parsing, splitting, and building Tee skins.\n\nThis crate provides tools for parsing a source Tee skin image into its constituent parts (body, feet, hands, eyes, etc.) and then composing them into a final character image with various expressions.\n\n## Features\n\n- `net`: Enables network requests (loading skins from URLs) using `Tee::new_from_url`.\n\n## Installation\n\nAdd this to your `Cargo.toml`:\n\n```toml\n[dependencies]\ntee_morphosis = \"1.3.0\"\n```\n\nTo use network capabilities (loading skins from URLs), enable the `net` feature:\n\n```toml\n[dependencies]\ntee_morphosis = { version = \"1.3.0\", features = [\"net\"] }\n```\n\n## How to Use\n\n### Example: Creating a skin from a local file\n\nHere's a simple example of how to read a skin file, create a character with \"happy\" eyes, and save the result to a new file.\n\n```rust\nuse std::fs;\nuse bytes::Bytes;\nuse tee_morphosis::tee::{\n    Tee,\n    parts::EyeType,\n    uv::TEE_UV_LAYOUT,\n    skin::TEE_SKIN_LAYOUT,\n};\nuse image::ImageFormat;\n\nfn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    // 1. Read your skin data from a file\n    // Replace \"path/to/your_skin.png\" with the actual path\n    let skin_data = fs::read(\"path/to/your_skin.png\")?;\n\n    // 2. Create a Tee instance from the image data\n    let tee = Tee::new(\n        Bytes::from(skin_data),\n        TEE_UV_LAYOUT,\n        ImageFormat::Png,\n    )?;\n\n    // 3. Compose the final image with the desired eye type\n    let eye_type = EyeType::Happy;\n    let image_bytes = tee.compose(\n        TEE_SKIN_LAYOUT,\n        eye_type,\n        ImageFormat::Png,\n    )?;\n\n    // or use\n    //\n    // tee.compose_default(TEE_SKIN_LAYOUT)?;\n\n    // 4. Save the result to a file\n    fs::write(\"composed_tee.png\", \u0026image_bytes)?;\n\n    println!(\"Skin successfully created and saved to composed_tee.png\");\n\n    Ok(())\n}\n```\n\n### Example: Tee color rotating\n\nHere's a simple example of how to change color with DDNet color value (or hls)\n\n```rust\nuse std::fs;\nuse bytes::Bytes;\nuse tee_morphosis::tee::{\n    Tee,\n    hsl::ddnet_color_to_hsl,\n    parts::TeePart\n};\nuse image::ImageFormat;\n\nfn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    // 1. Read your skin data from a file\n    // Replace \"path/to/your_skin.png\" with the actual path\n    let skin_data = fs::read(\"path/to/your_skin.png\")?;\n\n    // 2. Create a Tee instance from the image data\n    let mut tee = Tee::new(\n        Bytes::from(skin_data),\n        TEE_UV_LAYOUT,\n        ImageFormat::Png,\n    )?;\n\n    // 3. Generate hls from ddnet value\n    let hsl = ddnet_color_to_hsl(1900500);\n    // 4. apply to all parts\n    tee.apply_hsv_to_all(hsl);\n    // 4.1 or peer parts\n    tee.apply_hsv_to_parts(hsl, \u0026[TeePart::Body, TeePart::BodyShadow]);\n    // 5. Now, compose it\n    let composed = tee.compose_default(TEE_SKIN_LAYOUT)?;\n\n    // 4. Save the result to a file\n    fs::write(\"colored_composed_tee.png\", \u0026composed)?;\n\n    println!(\"Skin successfully created, colored and saved to colored_composed_tee.png\");\n\n    Ok(())\n}\n```\n\n### Example: Loading and creating a skin from a URL (with `net` feature)\n\nThis example demonstrates how to fetch a skin from the internet and assemble it.\n\n```rust\nuse tee_morphosis::tee::{\n    Tee,\n    parts::EyeType,\n    uv::TEE_UV_LAYOUT,\n    skin::TEE_SKIN_LAYOUT,\n};\nuse std::fs;\nuse image::ImageFormat;\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    // 1. Create a Tee instance from a URL\n    let tee = Tee::new_from_url(\n        \"https://teedata.net/databasev2/skins/glow_rainbow/glow_rainbow.png\",\n        TEE_UV_LAYOUT,\n    ).await?;\n\n    // 2. Compose the final image\n    let image_bytes = tee.compose(\n        TEE_SKIN_LAYOUT,\n        EyeType::Surprise,\n        ImageFormat::Png,\n    )?;\n\n    // 3. Save the result\n    fs::write(\"composed_from_url.png\", \u0026image_bytes)?;\n\n    println!(\"Skin successfully downloaded and saved to composed_from_url.png\");\n\n    Ok(())\n}\n```\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpulseclient-ddnet%2Ftee-morphosis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpulseclient-ddnet%2Ftee-morphosis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpulseclient-ddnet%2Ftee-morphosis/lists"}