{"id":29829888,"url":"https://github.com/chrynan/imagery","last_synced_at":"2025-10-19T09:15:54.552Z","repository":{"id":57168072,"uuid":"360355779","full_name":"chRyNaN/imagery","owner":"chRyNaN","description":"Components and utilities for working with images in Kotlin.","archived":false,"fork":false,"pushed_at":"2022-10-28T22:57:20.000Z","size":266,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-02-27T06:41:52.514Z","etag":null,"topics":["image","image-processing","kotlin","kotlin-library","kotlin-multi-platform","kotlin-multiplatform","kotlin-multiplatform-library"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chRyNaN.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}},"created_at":"2021-04-22T01:25:43.000Z","updated_at":"2022-08-20T19:50:56.000Z","dependencies_parsed_at":"2022-09-12T07:52:49.985Z","dependency_job_id":null,"html_url":"https://github.com/chRyNaN/imagery","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/chRyNaN/imagery","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chRyNaN%2Fimagery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chRyNaN%2Fimagery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chRyNaN%2Fimagery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chRyNaN%2Fimagery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chRyNaN","download_url":"https://codeload.github.com/chRyNaN/imagery/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chRyNaN%2Fimagery/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267665408,"owners_count":24124530,"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-07-29T02:00:12.549Z","response_time":2574,"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":["image","image-processing","kotlin","kotlin-library","kotlin-multi-platform","kotlin-multiplatform","kotlin-multiplatform-library"],"created_at":"2025-07-29T09:41:34.641Z","updated_at":"2025-10-19T09:15:54.462Z","avatar_url":"https://github.com/chRyNaN.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# imagery\n\nComponents and utilities for working with images in Kotlin. \u003cbr/\u003e\n\u003cimg alt=\"GitHub tag (latest by date)\" src=\"https://img.shields.io/github/v/tag/chRyNaN/imagery\"\u003e\n\n## Using the library\n\nThe `Image` model contains everything necessary to represent an image and all of its associated data. All the models are\nserializable with [kotlinx.serialization](https://github.com/Kotlin/kotlinx.serialization). To create an instance of\nan `Image`, a URI is required that points to the image resource. All other fields are optional.\n\n```kotlin\nval image = Image(\n    uri = \"https://example.com/image\"\n)\n```\n\nThe `Image` model contains useful optional properties, such as `blurHash` and `focalPoint`.\nA [BlurHash](https://blurha.sh/) can be used as a placeholder while the image resource is loading.\nA [FocalPoint](https://github.com/jonom/jquery-focuspoint) keeps the most important part of the image visible when the\nimage is clipped.\n\nA BlurHash for an image can be obtained using a `BlurHashEncoder`:\n\n```kotlin\nval encoder = BlurHashEncoder()\n\nval blurHash = encoder.encode(\n    pixelsArray,\n    width,\n    height,\n    componentX,\n    componentY,\n)\n```\n\nWhen a BlurHash is obtained, it can be rendered to an image array that can be displayed while the image is loading.\n\n```kotlin\nval decoder = BlurHashDecoder()\n\nval result = decoder.decode(\n    blurHash,\n    width,\n    height,\n    punch,\n)\n\n// The result.pixels array can be used to create a platform Bitmap object.\nresult.pixels\n```\n\nA `FocalPoint` is created by telling which coordinates in the image array are the most important.\n\n```kotlin\nFocalPoint(\n    imageX,\n    imageY,\n    imageWidth,\n    imageHeight\n)\n```\n\nA `FocalPoint` can be used to get the area of the image that should be displayed if the view size is smaller than the\nimage, and the scale type is set to matrix.\n\n```kotlin\nval resolver = FocalPointResolver()\n\nval result = resolver.resolve(\n    viewWidth,\n    viewHeight,\n    imageWidth,\n    imageHeight,\n    focalPoint,\n)\n\n// The result object contains everything needed to create a platform matrix object to scale the image appropriately.\nresult.scale\nresult.dx\nresult.dy\n```\n\n### ImageCreator\n\nAn `ImageCreator` can be used to create instances of an `Image`, including all of its data, such as the Blur Hash, in a single function call.\n\n```kotlin\nval imageCreator = ImageCreator(blurHashEncoder, uriMimeTypeResolver)\n\nval image = imageCreator.create(\n        uri,\n        width,\n        height,\n        pixels,\n        blurHashComponentX,\n        blurHashComponentY,\n        focalPointX,\n        focalPointY\n)\n```\n\n## Building the library\n\nThe library is provided through [Repsy.io](https://repsy.io). Checkout\nthe [releases page](https://github.com/chRyNaN/colors/releases) to get the latest version. \u003cbr/\u003e\n\u003cimg alt=\"GitHub tag (latest by date)\" src=\"https://img.shields.io/github/v/tag/chRyNaN/imagery\"\u003e\n\n### Repository\n\n```groovy\nrepositories {\n    maven { url = \"https://repo.repsy.io/mvn/chrynan/public\" }\n}\n```\n\n### Dependencies\n\n**Core:**\n```groovy\nimplementation \"com.chrynan.imagery:imagery-core:VERSION\"\n```\n\n**Android:**\n```groovy\nimplementation \"com.chrynan.imagery:imagery-android:VERSION\"\n```\n\n## Documentation\n\nMore detailed documentation is available in the [docs] folder. The entry point to the documentation can be\nfound [here](docs/index.md).\n\n## License\n\n```\nCopyright 2021 chRyNaN\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrynan%2Fimagery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrynan%2Fimagery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrynan%2Fimagery/lists"}