{"id":13749932,"url":"https://github.com/tidev/ti.imagefactory","last_synced_at":"2025-05-13T18:33:36.701Z","repository":{"id":15872914,"uuid":"18613694","full_name":"tidev/ti.imagefactory","owner":"tidev","description":"The ImageFactory Module for Appcelerator Titanium","archived":false,"fork":false,"pushed_at":"2024-11-26T15:40:28.000Z","size":5649,"stargazers_count":67,"open_issues_count":16,"forks_count":51,"subscribers_count":25,"default_branch":"stable","last_synced_at":"2025-05-09T13:42:39.886Z","etag":null,"topics":["android","compress","imagefactory","ios","rotate-image","rounded-corners","titanium-module"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"shy0013/electron-api-demos","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tidev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"tidev","liberapay":"tidev"}},"created_at":"2014-04-09T21:17:08.000Z","updated_at":"2024-08-05T03:16:19.000Z","dependencies_parsed_at":"2024-08-29T04:01:46.406Z","dependency_job_id":"94ecdec4-0846-4a2a-b760-b96dfa1f0de7","html_url":"https://github.com/tidev/ti.imagefactory","commit_stats":null,"previous_names":["appcelerator-modules/ti.imagefactory"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidev%2Fti.imagefactory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidev%2Fti.imagefactory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidev%2Fti.imagefactory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidev%2Fti.imagefactory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tidev","download_url":"https://codeload.github.com/tidev/ti.imagefactory/tar.gz/refs/heads/stable","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254003524,"owners_count":21997898,"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","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":["android","compress","imagefactory","ios","rotate-image","rounded-corners","titanium-module"],"created_at":"2024-08-03T07:01:18.865Z","updated_at":"2025-05-13T18:33:36.658Z","avatar_url":"https://github.com/tidev.png","language":"Java","funding_links":["https://github.com/sponsors/tidev","https://liberapay.com/tidev"],"categories":["Python"],"sub_categories":[],"readme":"# Titanium ImageFactory Module\n\nTi.ImageFactory provides a set of image transformation functions including the ability to scale, crop, and compress images. Additionally, this module offers the functionality of adding alpha channels and transparent borders.\n\n## Getting Started\n\nView the [Using Titanium Modules](http://docs.appcelerator.com/titanium/latest/#!/guide/Using_Titanium_Modules) document for instructions on getting\nstarted with using this module in your application.\n\n## Accessing the Ti.ImageFactory Module\n\nTo access this module from JavaScript, you would do the following:\n\n```js\nconst ImageFactory = require('ti.imagefactory');\n```\n\n## Methods\n\n### imageWithRotation(blob, options)\n\nCreates a new image by creating a copy of the given image that is rotated.\n\n#### Arguments\n\n* Image blob[blob]: Image to transform\n* Options[dictionary]: A dictionary specifying the options for the transformation\n    * degrees[int]: The degrees to rotate the image\n\n### imageWithAlpha(blob, options)\n\nCreates a new image by creating a copy of the given image, adding an alpha channel if it doesn't already have one.\n\n#### Arguments\n\n* Image blob[blob]: Image to transform\n* Options[dictionary]: A dictionary specifying the options for the transformation\n    * iOS: Currently there are no properties for this method -- specify an empty dictionary\n    * Android: format [int]: The output format: ImageFactory.JPEG, ImageFactory.PNG, ImageFactory.WEBP (default: ImageFactory.JPEG)\n    * Android: quality[float]: The quality of the resulting JPEG or WebP image, expressed as a value from 0.0 to 1.0. The value 0.0 represents the maximum compression (or lowest quality) while the value 1.0 represents the least compression (or best quality). (default: 0.7)\n\n### imageWithTransparentBorder(blob, options)\n\nCreates a new image by creating a copy of the given image, adding a transparent border of the given size around its edges. The size of the image will be expanded by the specified border size.\n\n#### Arguments\n\n* Image blob[blob]: Image to transform\n* Options[dictionary]: A dictionary specifying the options for the transformation\n    * borderSize[int]: The size of the border (default: 1)\n    * Android: format [int]: The output format: ImageFactory.JPEG, ImageFactory.PNG, ImageFactory.WEBP (default: ImageFactory.JPEG)\n    * Android: quality[float]: The quality of the resulting JPEG or WebP image, expressed as a value from 0.0 to 1.0. The value 0.0 represents the maximum compression (or lowest quality) while the value 1.0 represents the least compression (or best quality). (default: 0.7)\n\n### imageWithRoundedCorner(blob, options)\n\nCreates a new image by creating a copy of the given image with rounded corners.\n\n#### Arguments\n\n* Image blob[blob]: Image to transform\n* Options[dictionary]: A dictionary specifying the options for the transformation\n   * borderSize[int]: The size of the border (default: 1)\n   * cornerRadius[int]: The radius of the corner edges (default: 0)\n   * Android: format [int]: The output format: ImageFactory.JPEG, ImageFactory.PNG, ImageFactory.WEBP (default: ImageFactory.JPEG).\n   * Android: quality[float]: The quality of the resulting JPEG or WebP image, expressed as a value from 0.0 to 1.0. The value 0.0 represents the maximum compression (or lowest quality) while the value 1.0 represents the least compression (or best quality). (default: 0.7).\n\n### imageAsThumbnail(blob, options)\n\nCreates a new image by creating a copy of the given image that is squared to the thumbnail size.\n\n#### Arguments\n\n* Image blob[blob]: Image to transform\n* Options[dictionary]: A dictionary specifying the options for the transformation\n    * size[int]: The size of the thumbnail (default: 48)\n    * borderSize[int]: The size of the border (default: 1)\n    * cornerRadius[int]: The radius of the corner edges (default:0)\n    * iOS: quality[int]: The interpolation quality. One of the following constants (default: imagefactory.QUALITY\\_HIGH)\n        * imagefactory.QUALITY\\_DEFAULT\n        * imagefactory.QUALITY\\_NONE\n        * imagefactory.QUALITY\\_LOW\n        * imagefactory.QUALITY\\_MEDIUM\n        * imagefactory.QUALITY\\_HIGH\n    * Android: quality[float]: The quality of the resulting JPEG or WebP image, expressed as a value from 0.0 to 1.0. The value 0.0 represents the maximum compression (or lowest quality) while the value 1.0 represents the least compression (or best quality). (default: 0.7)\n    * Android: dither[boolean]: Indicates if dithering should be applied while scaling. (default: false)\n    * Android: format [int]: The output format: ImageFactory.JPEG, ImageFactory.PNG, ImageFactory.WEBP (default: ImageFactory.JPEG)\n\n### imageAsResized(blob, options)\n\nCreates a new image by creating a copy of the given image that is rescaled to the specified size.\n\n#### Arguments\n\n* Image blob[blob]: Image to transform\n* Options[dictionary]: A dictionary specifying the options for the transformation\n    * width[int]: The width of the new image (default: image width)\n    * height[int]: The height of the new image (default: image height)\n    * iOS: hires[boolean]: Create a hires image (for Retina displays only)\n    * iOS: quality[int]: The interpolation quality. One of the following constants (default: imagefactory.QUALITY\\_HIGH)\n        * imagefactory.QUALITY\\_DEFAULT\n        * imagefactory.QUALITY\\_NONE\n        * imagefactory.QUALITY\\_LOW\n        * imagefactory.QUALITY\\_MEDIUM\n        * imagefactory.QUALITY\\_HIGH\n    * Android. format [int]: The output format of the image: either ImageFactory.PNG or ImageFactory.JPEG (default: ImageFactory.JPEG)\n    * quality[float]: The quality of the resulting JPEG or WebP image, expressed as a value from 0.0 to 1.0. The value 0.0 represents the maximum compression (or lowest quality) while the value 1.0 represents the least compression (or best quality). (default: 0.7)\n\n### imageAsCropped(blob, options)\n\nCreates a new image by creating a copy of the given image that is cropped to the specified bounds.\n\n#### Arguments\n\n* Image blob[blob]: Image to transform\n* Options[dictionary]: A dictionary specifying the options for the transformation\n    * width[int]: The width of the new image (default: image width)\n    * height[int]: The height of the new image (default: image height)\n    * x[int]: The x-coordinate of the upper-left corner of the bounds (default: image center - width / 2)\n    * y[int]: The y-coordinate of the upper-left corner of the bounds (default: image center - height / 2)\n    * Android: format [int]: The output format: ImageFactory.JPEG, ImageFactory.PNG, ImageFactory.WEBP (default: ImageFactory.JPEG)\n    * Android: quality[float]: The quality of the resulting JPEG or WebP image, expressed as a value from 0.0 to 1.0. The value 0.0 represents the maximum compression (or lowest quality) while the value 1.0 represents the least compression (or best quality). (default: 0.7)\n\n### imageTransform(blob, options)\n\nCreates a new image by applying a sequence of transformations to the image.\n\n#### Arguments\n\n* Image blob[blob]: Image to transform\n* Transform[dictionary]: A sequence of transform specifications. Transforms are listed as additional parameters to the function and are applied in the order specified. Each transform is a dictionary with the options described above for each transform along with an additional 'type' property included with each dictionary of transform options.\n    * type[int]: The identifier of the transform to apply. One of the following constants\n        * imagefactory.TRANSFORM\\_CROP\n        * imagefactory.TRANSFORM\\_RESIZE\n        * imagefactory.TRANSFORM\\_THUMBNAIL\n        * imagefactory.TRANSFORM\\_ROUNDEDCORNER\n        * imagefactory.TRANSFORM\\_TRANSPARENTBORDER\n        * imagefactory.TRANSFORM\\_ALPHA\n    * options as described in the above transforms\n\n### compress(blob, quality [, format])\n\nCreates a new image by creating a copy of the given image and applying the specified compression quality.\n\n#### Arguments\n\n* Image blob[blob]: Image to compress\n* Compression Quality[float]; The quality of the resulting JPEG or WebP image, expressed as a value from 0.0 to 1.0. The value 0.0 represents the maximum compression (or lowest quality) while the value 1.0 represents the least compression (or best quality).\n* Android (optional): format [int]: The output format: ImageFactory.JPEG, ImageFactory.PNG, ImageFactory.WEBP (default: ImageFactory.JPEG)\n\n### compressToFile(blob, quality, fileUrl)\n\nCompresses the given blob to an image file.\n\n#### Arguments\n\n* Image blob[blob]: Image to write to file\n* Compression Quality[float]; The quality of the resulting JPEG or WebP image, expressed as a value from 0.0 to 1.0. The value 0.0 represents the maximum compression (or lowest quality) while the value 1.0 represents the least compression (or best quality).\n* fileUrl [string]: File path to write the image to. Supports extensions \".png\", \".jpg\", and \".jpeg\". Android also supports \".webp\".\n\n## Usage\n\nSee [example](https://github.com/appcelerator-modules/ti.imagefactory/blob/stable/example/app.js).\n\n## License\n\nApache 2\n\n## Copyright\n\n2011-present by Axway Appcelerator\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftidev%2Fti.imagefactory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftidev%2Fti.imagefactory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftidev%2Fti.imagefactory/lists"}