{"id":13653086,"url":"https://github.com/ethereon/lycon","last_synced_at":"2025-04-05T11:08:53.207Z","repository":{"id":50427836,"uuid":"79044131","full_name":"ethereon/lycon","owner":"ethereon","description":"A minimal and fast image library for Python and C++","archived":false,"fork":false,"pushed_at":"2021-01-10T19:34:28.000Z","size":166,"stargazers_count":288,"open_issues_count":17,"forks_count":27,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-03-29T10:06:12.796Z","etag":null,"topics":["computer-vision","cpp","image-processing","python"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ethereon.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":"2017-01-15T16:23:52.000Z","updated_at":"2025-03-24T00:00:23.000Z","dependencies_parsed_at":"2022-07-31T03:08:03.507Z","dependency_job_id":null,"html_url":"https://github.com/ethereon/lycon","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethereon%2Flycon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethereon%2Flycon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethereon%2Flycon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethereon%2Flycon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ethereon","download_url":"https://codeload.github.com/ethereon/lycon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247325693,"owners_count":20920714,"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":["computer-vision","cpp","image-processing","python"],"created_at":"2024-08-02T02:01:05.683Z","updated_at":"2025-04-05T11:08:53.164Z","avatar_url":"https://github.com/ethereon.png","language":"C++","readme":"# Lycon\n\nA minimal and fast image library for Python and C++.\n\nLycon is a small subset of optimized image operations derived from [OpenCV](http://opencv.org/).\n\nCurrent set of features include:\n\n- Reading and writing JPEG and PNG images\n- Fast SIMD optimized image resizing\n- Zero-copy interop with [NumPy](http://www.numpy.org/) whenever possible\n\nTested on:\n\n- Linux (Ubuntu 14.04) with Python`2.7.6` and `3.5.2`.\n- macOS (Sierra, 10.12) with Python `2.7.11` and `3.5.1`.\n\n## Install\n\n```\npip install lycon\n```\n\nNative extension dependencies:\n\n- CMake 2.8 or newer\n- C++ toolchain\n- LibJPEG\n- LibPNG\n\n### Ubuntu\n\nSingle-line command for installing all dependencies:\n\n```\nsudo apt-get install cmake build-essential libjpeg-dev libpng-dev\n```\n\n### Anaconda\n\nWhen working within an Anaconda Python distribution, it is recommended to use the latest `cmake` version (`3.6` or newer). Older versions can lead to a mismatch between the `libpng` and `libjpeg` headers used to build Lycon (usually the system headers), and the linked library (which may be preempted by the Anaconda-scoped version). To install the latest `cmake` version:\n\n```\nconda install cmake\n```\n\n## Example\n\n```python\nimport lycon\n\n# Load an image as a numpy array\nimg = lycon.load('mittens.jpg')\n# Resize the image using bicubic interpolation\nresized = lycon.resize(img, width=256, height=512, interpolation=lycon.Interpolation.CUBIC)\n# Crop the image (like any regular numpy array)\ncropped = resized[:100, :200]\n# Save the image\nlycon.save('cropped-mittens.png', cropped)\n```\n\n## Limitations\n\nCompared to other image processing libraries ([OpenCV](http://opencv.org/), [pillow](https://python-pillow.org/), [scikit-image](http://scikit-image.org/)), Lycon offers a very limited set of operations. Intended usages include data loaders for deep learning, mass image resizing, etc.\n\n## Advantages over OpenCV\n\n- Drastically smaller (at the cost of drastically fewer features)\n- Python module installable via `pip`\n- Images use the more common `RGB` ordering (vs OpenCV's `BGR`)\n\nHowever, if you already have OpenCV installed, Lycon's advantages are minimal.\n\n## Advantages over PIL(low)\n\n- Faster\n- First-class NumPy support\n- Full support for floating point images\n\n## Advantages over Scikit-Image\n\n- Drastically faster\n\n## Benchmarks\n\n- The table below lists execution time (in seconds), averaged across 10 runs\n- The multiplier next to the time is the relative slowdown compared to Lycon\n\n| Operation            |  Lycon |        OpenCV |             PIL |      Scikit-Image |\n|----------------------|-------:|--------------:|----------------:|------------------:|\n| Upsample: Nearest    | 0.1944 |   0.1948 (1x) |    2.1342 (11x) |  30.8982 (158.9x) |\n| Upsample: Bilinear   | 0.4852 |   0.4940 (1x) |    7.2940 (15x) |   45.9095 (94.6x) |\n| Upsample: Bicubic    | 1.8162 |   1.8182 (1x) |   8.9589 (4.9x) |  120.1645 (66.1x) |\n| Upsample: Lanczos    | 4.5641 |   4.5714 (1x) |  10.7517 (2.3x) |                   |\n| Upsample: Area       | 0.4801 |   0.4931 (1x) |                 |                   |\n| Downsample: Nearest  | 0.0183 |   0.0181 (1x) |  0.4379 (24.2x) |   3.6101 (199.9x) |\n| Downsample: Bilinear | 0.0258 |   0.0257 (1x) |    1.3122 (51x) |   4.8487 (188.4x) |\n| Downsample: Bicubic  | 0.1324 |   0.1329 (1x) |  1.8153 (13.7x) |    9.4905 (71.6x) |\n| Downsample: Lanczos  | 0.3317 |   0.3328 (1x) |   2.4058 (7.2x) |                   |\n| Downsample: Area     | 0.0258 |   0.0259 (1x) |                 |                   |\n| Read: JPG            | 0.3409 | 0.5085 (1.5x) |   1.4081 (4.1x) |     1.4628 (4.3x) |\n| Read: PNG            | 1.2114 | 1.3245 (1.1x) |   1.8274 (1.5x) |     1.8674 (1.5x) |\n| Write: JPG           | 0.4760 | 0.6046 (1.3x) |     2.3823 (5x) |    5.0159 (10.5x) |\n| Write: PNG           | 2.1421 |   2.2370 (1x) |   9.0580 (4.2x) |    11.6060 (5.4x) |\n\n- Blank cells indicate that the operation is not supported by the library\n- All operations performed on a 16k (15360 x 8640) RGB image\n- Tests performed on Ubuntu 14.04 running on an Intel Core i7 (Skylake)\n- OpenCV `3.2+ (master: a85b4b5)`, Pillow `4.0.0`, skimage `0.12.3`, Python `2.7.3`\n- OpenCV can potentially achieve better performance with GPU implementations and proprietary libraries like Intel IPP\n\n## License\n\n- All code derived from the OpenCV project is licensed under the 3-clause BSD License.\n- All Lycon-specific modifications are licensed under the MIT license.\n\nSee `LICENSE` for further details.\n","funding_links":[],"categories":["C++"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethereon%2Flycon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fethereon%2Flycon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethereon%2Flycon/lists"}