All Projects → appcelerator-modules → ti.imagefactory

appcelerator-modules / ti.imagefactory

Licence: Apache-2.0 license
The ImageFactory Module for Appcelerator Titanium

Programming Languages

java
68154 projects - #9 most used programming language
objective c
16641 projects - #2 most used programming language
javascript
184084 projects - #8 most used programming language
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to ti.imagefactory

Apiproject
[https://www.sofineday.com], golang项目开发脚手架,集成最佳实践(gin+gorm+go-redis+mongo+cors+jwt+json日志库zap(支持日志收集到kafka或mongo)+消息队列kafka+微信支付宝支付gopay+api加密+api反向代理+go modules依赖管理+headless爬虫chromedp+makefile+二进制压缩+livereload热加载)
Stars: ✭ 124 (+82.35%)
Mutual labels:  compress
RecordVideo
视频录制压缩
Stars: ✭ 47 (-30.88%)
Mutual labels:  compress
ti.admob
Use the Google AdMob SDK on iOS and Android with Titanium
Stars: ✭ 51 (-25%)
Mutual labels:  titanium-module
Hsuntzu
HDFS compress tar zip snappy gzip uncompress untar codec hadoop spark
Stars: ✭ 135 (+98.53%)
Mutual labels:  compress
Compresshelper
🔥 压缩文件,压缩图片,压缩Bitmap,Compress, CompressImage, CompressFile, CompressBitmap:https://github.com/nanchen2251/AiYaCompressHelper
Stars: ✭ 2,362 (+3373.53%)
Mutual labels:  compress
SSImagePicker
Easy to use and configurable library to Pick an image from the Gallery or Capture an image using a Camera... 📸
Stars: ✭ 227 (+233.82%)
Mutual labels:  rotate-image
Py7zr
7zip in python3 with ZStandard, PPMd, LZMA2, LZMA1, Delta, BCJ, BZip2, and Deflate compressions, and AES encryption.
Stars: ✭ 110 (+61.76%)
Mutual labels:  compress
xcompress
XCompress is a free file archiver utility on Linux, providing multi-format archiving to and extracting from ZIP, Z, GZIP, BZIP2, LZ, XZ, LZMA, 7ZIP, TAR, RAR and ZSTD.
Stars: ✭ 65 (-4.41%)
Mutual labels:  compress
Tiny
Blog:https://zhengxiaoyong.com Wechat:
Stars: ✭ 2,505 (+3583.82%)
Mutual labels:  compress
web-dist
传统模式开发的web站点 进行整站所有文件压缩及混淆处理
Stars: ✭ 43 (-36.76%)
Mutual labels:  compress
Cordova Plugin Mediapicker
cordova android ios mediaPicker support selection of multiple image and video gif ✨ cordova android 和 ios 图片视频选择cordova插件,支持多图 视频 gif,ui类似微信
Stars: ✭ 136 (+100%)
Mutual labels:  compress
Snzip
Snzip, a compression/decompression tool based on snappy
Stars: ✭ 177 (+160.29%)
Mutual labels:  compress
ti.youtube
A small library to get the URL of the desired YouTube video ID to use it natively in Ti.Media.VideoPlayer.
Stars: ✭ 13 (-80.88%)
Mutual labels:  titanium-module
Slim
Surprisingly space efficient trie in Golang(11 bits/key; 100 ns/get).
Stars: ✭ 1,705 (+2407.35%)
Mutual labels:  compress
slimarray
SlimArray compresses uint32 into several bits, by using a polynomial to describe overall trend of an array.
Stars: ✭ 39 (-42.65%)
Mutual labels:  compress
Tiny Html Minifier
Minify HTML in PHP with just a single class
Stars: ✭ 114 (+67.65%)
Mutual labels:  compress
RoundWidget
Java 实现的 Android 原生圆角矩形控件,圆角 FrameLayout 和圆角 ImageView
Stars: ✭ 86 (+26.47%)
Mutual labels:  rounded-corners
pclzip-doc-zh-cn
PHP 库 PclZip 的简体中文翻译文档(zh-cn translation for PHP lib: PclZip)
Stars: ✭ 25 (-63.24%)
Mutual labels:  compress
titanium-alternate-icons
Leverage the ability to change the app icon in iOS 10.3+
Stars: ✭ 24 (-64.71%)
Mutual labels:  titanium-module
ZipArchive
A single-class pure VB6 library for zip with ASM speed
Stars: ✭ 38 (-44.12%)
Mutual labels:  compress

Titanium ImageFactory Module

Ti.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.

Getting Started

View the Using Titanium Modules document for instructions on getting started with using this module in your application.

Accessing the Ti.ImageFactory Module

To access this module from JavaScript, you would do the following:

const ImageFactory = require('ti.imagefactory');

Methods

imageWithRotation(blob, options)

Creates a new image by creating a copy of the given image that is rotated.

Arguments

  • Image blob[blob]: Image to transform
  • Options[dictionary]: A dictionary specifying the options for the transformation
    • degrees[int]: The degrees to rotate the image

imageWithAlpha(blob, options)

Creates a new image by creating a copy of the given image, adding an alpha channel if it doesn't already have one.

Arguments

  • Image blob[blob]: Image to transform
  • Options[dictionary]: A dictionary specifying the options for the transformation
    • iOS: Currently there are no properties for this method -- specify an empty dictionary
    • Android: format [int]: The output format: ImageFactory.JPEG, ImageFactory.PNG, ImageFactory.WEBP (default: ImageFactory.JPEG)
    • 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)

imageWithTransparentBorder(blob, options)

Creates 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.

Arguments

  • Image blob[blob]: Image to transform
  • Options[dictionary]: A dictionary specifying the options for the transformation
    • borderSize[int]: The size of the border (default: 1)
    • Android: format [int]: The output format: ImageFactory.JPEG, ImageFactory.PNG, ImageFactory.WEBP (default: ImageFactory.JPEG)
    • 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)

imageWithRoundedCorner(blob, options)

Creates a new image by creating a copy of the given image with rounded corners.

Arguments

  • Image blob[blob]: Image to transform
  • Options[dictionary]: A dictionary specifying the options for the transformation
    • borderSize[int]: The size of the border (default: 1)
    • cornerRadius[int]: The radius of the corner edges (default: 0)
    • Android: format [int]: The output format: ImageFactory.JPEG, ImageFactory.PNG, ImageFactory.WEBP (default: ImageFactory.JPEG).
    • 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).

imageAsThumbnail(blob, options)

Creates a new image by creating a copy of the given image that is squared to the thumbnail size.

Arguments

  • Image blob[blob]: Image to transform
  • Options[dictionary]: A dictionary specifying the options for the transformation
    • size[int]: The size of the thumbnail (default: 48)
    • borderSize[int]: The size of the border (default: 1)
    • cornerRadius[int]: The radius of the corner edges (default:0)
    • iOS: quality[int]: The interpolation quality. One of the following constants (default: imagefactory.QUALITY_HIGH)
      • imagefactory.QUALITY_DEFAULT
      • imagefactory.QUALITY_NONE
      • imagefactory.QUALITY_LOW
      • imagefactory.QUALITY_MEDIUM
      • imagefactory.QUALITY_HIGH
    • 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)
    • Android: dither[boolean]: Indicates if dithering should be applied while scaling. (default: false)
    • Android: format [int]: The output format: ImageFactory.JPEG, ImageFactory.PNG, ImageFactory.WEBP (default: ImageFactory.JPEG)

imageAsResized(blob, options)

Creates a new image by creating a copy of the given image that is rescaled to the specified size.

Arguments

  • Image blob[blob]: Image to transform
  • Options[dictionary]: A dictionary specifying the options for the transformation
    • width[int]: The width of the new image (default: image width)
    • height[int]: The height of the new image (default: image height)
    • iOS: hires[boolean]: Create a hires image (for Retina displays only)
    • iOS: quality[int]: The interpolation quality. One of the following constants (default: imagefactory.QUALITY_HIGH)
      • imagefactory.QUALITY_DEFAULT
      • imagefactory.QUALITY_NONE
      • imagefactory.QUALITY_LOW
      • imagefactory.QUALITY_MEDIUM
      • imagefactory.QUALITY_HIGH
    • Android. format [int]: The output format of the image: either ImageFactory.PNG or ImageFactory.JPEG (default: ImageFactory.JPEG)
    • 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)

imageAsCropped(blob, options)

Creates a new image by creating a copy of the given image that is cropped to the specified bounds.

Arguments

  • Image blob[blob]: Image to transform
  • Options[dictionary]: A dictionary specifying the options for the transformation
    • width[int]: The width of the new image (default: image width)
    • height[int]: The height of the new image (default: image height)
    • x[int]: The x-coordinate of the upper-left corner of the bounds (default: image center - width / 2)
    • y[int]: The y-coordinate of the upper-left corner of the bounds (default: image center - height / 2)
    • Android: format [int]: The output format: ImageFactory.JPEG, ImageFactory.PNG, ImageFactory.WEBP (default: ImageFactory.JPEG)
    • 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)

imageTransform(blob, options)

Creates a new image by applying a sequence of transformations to the image.

Arguments

  • Image blob[blob]: Image to transform
  • 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.
    • type[int]: The identifier of the transform to apply. One of the following constants
      • imagefactory.TRANSFORM_CROP
      • imagefactory.TRANSFORM_RESIZE
      • imagefactory.TRANSFORM_THUMBNAIL
      • imagefactory.TRANSFORM_ROUNDEDCORNER
      • imagefactory.TRANSFORM_TRANSPARENTBORDER
      • imagefactory.TRANSFORM_ALPHA
    • options as described in the above transforms

compress(blob, quality [, format])

Creates a new image by creating a copy of the given image and applying the specified compression quality.

Arguments

  • Image blob[blob]: Image to compress
  • 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).
  • Android (optional): format [int]: The output format: ImageFactory.JPEG, ImageFactory.PNG, ImageFactory.WEBP (default: ImageFactory.JPEG)

compressToFile(blob, quality, fileUrl)

Compresses the given blob to an image file.

Arguments

  • Image blob[blob]: Image to write to file
  • 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).
  • fileUrl [string]: File path to write the image to. Supports extensions ".png", ".jpg", and ".jpeg". Android also supports ".webp".

Usage

See example.

License

Apache 2

Copyright

2011-present by Axway Appcelerator

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].