[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-7214":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":10,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":22,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":37,"readmeContent":38,"aiSummary":39,"trendingCount":16,"starSnapshotCount":16,"syncStatus":40,"lastSyncTime":41,"discoverSource":42},7214,"Compressor","zetbaitsu\u002FCompressor","zetbaitsu","An android image compression library.","",null,"Kotlin",7221,964,141,133,0,1,3,6,4,39.95,false,"master",true,[26,27,28,29,30,31,32,33,34,35,36],"android","android-library","compress-images","compression","compressor","image-compression","kotlin","kotlin-android","kotlin-coroutines","kotlin-library","photos","2026-06-12 02:01:36","Compressor\n======\n[![Android Arsenal](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FAndroid%20Arsenal-Compressor-blue.svg?style=flat)](http:\u002F\u002Fandroid-arsenal.com\u002Fdetails\u002F1\u002F3758)\n[![Build Status](https:\u002F\u002Ftravis-ci.org\u002Fzetbaitsu\u002FCompressor.svg?branch=master)](https:\u002F\u002Ftravis-ci.org\u002Fzetbaitsu\u002FCompressor)\n[![codecov](https:\u002F\u002Fcodecov.io\u002Fgh\u002Fzetbaitsu\u002FCompressor\u002Fbranch\u002Fmaster\u002Fgraph\u002Fbadge.svg)](https:\u002F\u002Fcodecov.io\u002Fgh\u002Fzetbaitsu\u002FCompressor)\n\u003Cp align=\"center\">\u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fzetbaitsu\u002FCompressor\u002Fmaster\u002Fss.png\" width=\"50%\" \u002F>\u003C\u002Fp>\nCompressor is a lightweight and powerful android image compression library. Compressor will allow you to compress large photos into smaller sized photos with very less or negligible loss in quality of the image.\n\n# Gradle\n```groovy\ndependencies {\n    implementation 'id.zelory:compressor:3.0.1'\n}\n```\n# Let's compress the image size!\n#### Compress Image File\n```kotlin\nval compressedImageFile = Compressor.compress(context, actualImageFile)\n```\n#### Compress Image File to specific destination\n```kotlin\nval compressedImageFile = Compressor.compress(context, actualImageFile) {\n    default()\n    destination(myFile)\n}\n```\n### I want custom Compressor!\n#### Using default constraint and custom partial of it\n```kotlin\nval compressedImageFile = Compressor.compress(context, actualImageFile) {\n    default(width = 640, format = Bitmap.CompressFormat.WEBP)\n}\n```\n#### Full custom constraint\n```kotlin\nval compressedImageFile = Compressor.compress(context, actualImageFile) {\n    resolution(1280, 720)\n    quality(80)\n    format(Bitmap.CompressFormat.WEBP)\n    size(2_097_152) \u002F\u002F 2 MB\n}\n```\n#### Using your own custom constraint\n```kotlin\nclass MyLowerCaseNameConstraint: Constraint {\n    override fun isSatisfied(imageFile: File): Boolean {\n        return imageFile.name.all { it.isLowerCase() }\n    }\n\n    override fun satisfy(imageFile: File): File {\n        val destination = File(imageFile.parent, imageFile.name.toLowerCase())\n        imageFile.renameTo(destination)\n        return destination\n    }\n}\n\nval compressedImageFile = Compressor.compress(context, actualImageFile) {\n    constraint(MyLowerCaseNameConstraint()) \u002F\u002F your own constraint\n    quality(80) \u002F\u002F combine with compressor constraint\n    format(Bitmap.CompressFormat.WEBP)\n}\n```\n#### You can create your own extension too\n```kotlin\nfun Compression.lowerCaseName() {\n    constraint(MyLowerCaseNameConstraint())\n}\n\nval compressedImageFile = Compressor.compress(context, actualImageFile) {\n    lowerCaseName() \u002F\u002F your own extension\n    quality(80) \u002F\u002F combine with compressor constraint\n    format(Bitmap.CompressFormat.WEBP)\n}\n```\n\n### Compressor now is using Kotlin coroutines!\n#### Calling Compressor should be done from coroutines scope\n```kotlin\n\u002F\u002F e.g calling from activity lifecycle scope\nlifecycleScope.launch {\n    val compressedImageFile = Compressor.compress(context, actualImageFile)\n}\n\n\u002F\u002F calling from global scope\nGlobalScope.launch {\n    val compressedImageFile = Compressor.compress(context, actualImageFile)\n}\n```\n#### Run Compressor in main thread\n```kotlin\nval compressedImageFile = Compressor.compress(context, actualImageFile, Dispatchers.Main)\n```\n\n### Old version\nPlease read this [readme](https:\u002F\u002Fgithub.com\u002Fzetbaitsu\u002FCompressor\u002Fblob\u002Fmaster\u002FREADME_v2.md)\n\nLicense\n-------\n    Copyright (c) 2016 Zetra.\n    \n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http:\u002F\u002Fwww.apache.org\u002Flicenses\u002FLICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","Compressor 是一个轻量级且强大的 Android 图像压缩库。它能够将大尺寸的照片压缩成更小的文件，同时几乎不损失图像质量。项目采用 Kotlin 语言编写，并支持 Kotlin 协程技术，使得异步处理更加高效简洁。用户可以通过简单的 API 调用来实现图片压缩，还提供了丰富的自定义选项，如分辨率、质量、格式等参数设置，甚至允许开发者定义自己的约束条件。该库非常适合需要在移动应用中优化上传或存储图片性能的场景，比如社交媒体、电商应用等。",2,"2026-06-11 03:11:12","top_language"]