@oh-my-pi/pi-coding-agent 5.6.77 → 5.7.68

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/package.json +8 -8
  3. package/src/migrations.ts +1 -34
  4. package/src/utils/image-convert.ts +1 -1
  5. package/src/utils/image-resize.ts +2 -2
  6. package/src/vendor/photon/LICENSE.md +201 -0
  7. package/src/vendor/photon/README.md +158 -0
  8. package/src/vendor/photon/index.d.ts +3013 -0
  9. package/src/vendor/photon/index.js +4461 -0
  10. package/src/vendor/photon/photon_rs_bg.wasm +0 -0
  11. package/src/vendor/photon/photon_rs_bg.wasm.b64.js +1 -0
  12. package/src/vendor/photon/photon_rs_bg.wasm.d.ts +193 -0
  13. package/src/core/python-executor-display.test.ts +0 -42
  14. package/src/core/python-executor-lifecycle.test.ts +0 -99
  15. package/src/core/python-executor-mapping.test.ts +0 -41
  16. package/src/core/python-executor-per-call.test.ts +0 -49
  17. package/src/core/python-executor-session.test.ts +0 -103
  18. package/src/core/python-executor-streaming.test.ts +0 -77
  19. package/src/core/python-executor-timeout.test.ts +0 -35
  20. package/src/core/python-executor.lifecycle.test.ts +0 -139
  21. package/src/core/python-executor.result.test.ts +0 -49
  22. package/src/core/python-executor.test.ts +0 -180
  23. package/src/core/python-kernel-display.test.ts +0 -54
  24. package/src/core/python-kernel-env.test.ts +0 -138
  25. package/src/core/python-kernel-session.test.ts +0 -87
  26. package/src/core/python-kernel-ws.test.ts +0 -104
  27. package/src/core/python-kernel.lifecycle.test.ts +0 -249
  28. package/src/core/python-kernel.test.ts +0 -461
  29. package/src/core/python-modules.test.ts +0 -102
  30. package/src/core/python-prelude.test.ts +0 -140
  31. package/src/core/settings-manager-python.test.ts +0 -23
  32. package/src/core/streaming-output.test.ts +0 -26
  33. package/src/core/system-prompt.python.test.ts +0 -17
  34. package/src/core/tools/index.test.ts +0 -212
  35. package/src/core/tools/python-execution.test.ts +0 -68
  36. package/src/core/tools/python-fallback.test.ts +0 -72
  37. package/src/core/tools/python-renderer.test.ts +0 -36
  38. package/src/core/tools/python-tool-mode.test.ts +0 -43
  39. package/src/core/tools/python.test.ts +0 -121
  40. package/src/core/tools/schema-validation.test.ts +0 -530
  41. package/src/core/tools/web-scrapers/academic.test.ts +0 -239
  42. package/src/core/tools/web-scrapers/business.test.ts +0 -82
  43. package/src/core/tools/web-scrapers/dev-platforms.test.ts +0 -254
  44. package/src/core/tools/web-scrapers/documentation.test.ts +0 -85
  45. package/src/core/tools/web-scrapers/finance-media.test.ts +0 -144
  46. package/src/core/tools/web-scrapers/git-hosting.test.ts +0 -272
  47. package/src/core/tools/web-scrapers/media.test.ts +0 -138
  48. package/src/core/tools/web-scrapers/package-managers-2.test.ts +0 -199
  49. package/src/core/tools/web-scrapers/package-managers.test.ts +0 -171
  50. package/src/core/tools/web-scrapers/package-registries.test.ts +0 -259
  51. package/src/core/tools/web-scrapers/research.test.ts +0 -107
  52. package/src/core/tools/web-scrapers/security.test.ts +0 -103
  53. package/src/core/tools/web-scrapers/social-extended.test.ts +0 -192
  54. package/src/core/tools/web-scrapers/social.test.ts +0 -259
  55. package/src/core/tools/web-scrapers/stackexchange.test.ts +0 -120
  56. package/src/core/tools/web-scrapers/standards.test.ts +0 -122
  57. package/src/core/tools/web-scrapers/wikipedia.test.ts +0 -73
  58. package/src/core/tools/web-scrapers/youtube.test.ts +0 -198
  59. package/src/discovery/helpers.test.ts +0 -131
package/CHANGELOG.md CHANGED
@@ -2,6 +2,21 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [5.7.68] - 2026-01-18
6
+ ### Changed
7
+
8
+ - Updated WASM loading to use base64-encoded WASM for better compatibility with compiled binaries
9
+
10
+ ### Fixed
11
+
12
+ - Fixed WASM loading issues in compiled binary builds
13
+
14
+ ## [5.7.67] - 2026-01-18
15
+ ### Changed
16
+
17
+ - Replaced external photon-node dependency with vendored WebAssembly implementation
18
+ - Updated image processing to use local photon library for better performance
19
+
5
20
  ## [5.6.70] - 2026-01-18
6
21
  ### Added
7
22
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oh-my-pi/pi-coding-agent",
3
- "version": "5.6.77",
3
+ "version": "5.7.68",
4
4
  "description": "Coding agent CLI with read, bash, edit, write tools and session management",
5
5
  "type": "module",
6
6
  "ompConfig": {
@@ -32,19 +32,19 @@
32
32
  "check": "tsgo -p tsconfig.check.json",
33
33
  "clean": "rm -rf dist",
34
34
  "build": "tsgo -p tsconfig.build.json && chmod +x dist/cli.js",
35
- "build:binary": "bun build --compile ./src/cli.ts --outfile dist/omp",
35
+ "build:binary": "bun run generate-wasm-b64 && bun build --compile ./src/cli.ts --outfile dist/omp",
36
+ "generate-wasm-b64": "bun scripts/generate-wasm-b64.ts",
36
37
  "generate-template": "bun scripts/generate-template.ts",
37
- "postinstall": "[ -f scripts/generate-template.ts ] && bun run generate-template || true",
38
+ "postinstall": "[ -f scripts/generate-wasm-b64.ts ] && bun run generate-wasm-b64 && bun run generate-template || true",
38
39
  "test": "bun test",
39
40
  "prepublishOnly": "bun run generate-template && bun run clean && bun run build"
40
41
  },
41
42
  "dependencies": {
42
- "@oh-my-pi/pi-agent-core": "5.6.77",
43
- "@oh-my-pi/pi-ai": "5.6.77",
44
- "@oh-my-pi/pi-git-tool": "5.6.77",
45
- "@oh-my-pi/pi-tui": "5.6.77",
43
+ "@oh-my-pi/pi-agent-core": "5.7.68",
44
+ "@oh-my-pi/pi-ai": "5.7.68",
45
+ "@oh-my-pi/pi-git-tool": "5.7.68",
46
+ "@oh-my-pi/pi-tui": "5.7.68",
46
47
  "@openai/agents": "^0.3.7",
47
- "@silvia-odwyer/photon-node": "^0.3.4",
48
48
  "@sinclair/typebox": "^0.34.46",
49
49
  "ajv": "^8.17.1",
50
50
  "chalk": "^5.5.0",
package/src/migrations.ts CHANGED
@@ -10,27 +10,6 @@ import { AgentStorage } from "./core/agent-storage";
10
10
  import type { AuthCredential } from "./core/auth-storage";
11
11
  import { logger } from "./core/logger";
12
12
 
13
- /**
14
- * Migrate PI_* environment variables to OMP_* equivalents.
15
- * If PI_XX is set and OMP_XX is not, set OMP_XX to PI_XX's value.
16
- * This provides backwards compatibility for users with existing PI_* env vars.
17
- *
18
- * @returns Array of PI_* env var names that were migrated
19
- */
20
- export function migrateEnvVars(): string[] {
21
- const migrated: string[] = [];
22
- for (const [key, value] of Object.entries(process.env)) {
23
- if (key.startsWith("PI_") && value !== undefined) {
24
- const ompKey = `OMP_${key.slice(3)}`; // PI_FOO -> OMP_FOO
25
- if (process.env[ompKey] === undefined) {
26
- process.env[ompKey] = value;
27
- migrated.push(key);
28
- }
29
- }
30
- }
31
- return migrated;
32
- }
33
-
34
13
  /**
35
14
  * Migrate legacy oauth.json and settings.json apiKeys to agent.db.
36
15
  *
@@ -199,24 +178,12 @@ export async function runMigrations(_cwd: string): Promise<{
199
178
  migratedAuthProviders: string[];
200
179
  deprecationWarnings: string[];
201
180
  }> {
202
- // First: migrate env vars (before anything else reads them)
203
- const migratedEnvVars = migrateEnvVars();
204
-
205
181
  // Then: run data migrations
206
182
  const migratedAuthProviders = migrateAuthToAgentDb();
207
183
  migrateSessionsFromAgentRoot();
208
184
  migrateToolsToBin();
209
185
 
210
- // Collect deprecation warnings
211
- const deprecationWarnings: string[] = [];
212
- if (migratedEnvVars.length > 0) {
213
- for (const envVar of migratedEnvVars) {
214
- const ompVar = `OMP_${envVar.slice(3)}`;
215
- deprecationWarnings.push(`${envVar} is deprecated. Use ${ompVar} instead.`);
216
- }
217
- }
218
-
219
- return { migratedAuthProviders, deprecationWarnings };
186
+ return { migratedAuthProviders, deprecationWarnings: [] };
220
187
  }
221
188
 
222
189
  /**
@@ -1,4 +1,4 @@
1
- import photon from "@silvia-odwyer/photon-node";
1
+ import * as photon from "../vendor/photon";
2
2
 
3
3
  /**
4
4
  * Convert image to PNG format for terminal display.
@@ -1,5 +1,5 @@
1
1
  import type { ImageContent } from "@oh-my-pi/pi-ai";
2
- import photon from "@silvia-odwyer/photon-node";
2
+ import * as photon from "../vendor/photon";
3
3
 
4
4
  export interface ImageResizeOptions {
5
5
  maxWidth?: number; // Default: 2000
@@ -94,7 +94,7 @@ export async function resizeImage(img: ImageContent, options?: ImageResizeOption
94
94
  height: number,
95
95
  jpegQuality: number,
96
96
  ): { buffer: Uint8Array; mimeType: string } {
97
- const resized = photon.resize(image!, width, height, photon.SamplingFilter.Lanczos3);
97
+ const resized = photon!.resize(image!, width, height, photon!.SamplingFilter.Lanczos3);
98
98
 
99
99
  try {
100
100
  const pngBuffer = resized.get_bytes();
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2023, Silvia O'Dwyer
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,158 @@
1
+ <p align="center">
2
+ <a href="" rel="noopener">
3
+ <img src="https://i.imgur.com/GxrKNOb.png" alt="Photon banner, showing the Photon logo on a dark background"></a>
4
+ </p>
5
+
6
+ <div align="center">
7
+
8
+ [![Status](https://img.shields.io/badge/status-active-success.svg)]()
9
+ [![GitHub Issues](https://img.shields.io/github/issues/silvia-odwyer/photon.svg)](https://github.com/silvia-odwyer/photon/issues)
10
+ [![GitHub Pull Requests](https://img.shields.io/github/issues-pr/silvia-odwyer/photon.svg)](https://github.com/silvia-odwyer/p/pulls)
11
+ [![Gitter chat](https://badges.gitter.im/silvia-odwyer/photon.png)](https://gitter.im/photonlibrary/community "Gitter chat")
12
+ [![Crates.io](https://img.shields.io/crates/v/photon-rs)](https://crates.io/crates/photon-rs)
13
+
14
+ </div>
15
+
16
+ ---
17
+
18
+ <p align="center"> High-performance, cross-platform Rust/WebAssembly image processing library
19
+ <br>
20
+ </p>
21
+
22
+ ## 📝 Table of Contents
23
+ - [Get Started with WebAssembly](https://github.com/silvia-odwyer/photon#-get-started-with-webassembly)
24
+ - [Get Started Natively](https://github.com/silvia-odwyer/photon#getting-started)
25
+ - [Documentation](https://docs.rs/photon-rs/0.1.0/)
26
+ - [Official Website.](https://silvia-odwyer.github.io/photon/)
27
+ - [All Available Functions.](https://silvia-odwyer.github.io/photon/docs/photon/all.html)
28
+ - [Got Questions? Ask Here!](https://github.com/silvia-odwyer/photon#got-questions)
29
+
30
+ Photon is a high-performance Rust image processing library, which compiles to WebAssembly, allowing for
31
+ safe, blazing-fast image processing both natively and on the web.
32
+
33
+ ### Features
34
+ - **Fast:** Photon outperforms even the fastest of libraries, including ImageMagick. On the web, its high-performance allows for near-native-speed image processing on the web. Benchmarks coming soon.
35
+ - **Call with JS:** Want to use Photon on the web or with Node? Using a simple npm package, you're good to go. Get all the benefits of WebAssembly
36
+ with zero-cost abstraction.
37
+ - **Use Natively:** For command-line apps, native photo editing apps, and so forth, Photon's core codebase is in Rust, allowing for cross-platform
38
+ development.
39
+
40
+ ### Live Demo
41
+ View the [official demo of WASM in action](https://silvia-odwyer.github.io/photon/demo.html).
42
+
43
+ ### Get Started
44
+ #### Getting Started Guide
45
+ Check out Photon's [getting started guide, complete with tutorials, installation instructions, and more](https://silvia-odwyer.github.io/photon/guide)
46
+
47
+ #### Documentation
48
+ ### 📚 Documentation
49
+ View the [official documentation](https://docs.rs/photon-rs/).
50
+
51
+ ### Photon In Action
52
+
53
+ ![Imgur](https://i.imgur.com/PShSZ6k.png)
54
+
55
+ ### Functionality
56
+ 96+ customisable functions are available.
57
+
58
+ Resize, transform, correct, and filter images: apply as many effects as desired.
59
+
60
+ Functions include:
61
+ - **Image correction**: Hue rotation, sharpening, brightness adjustment, adjusting saturation, lightening/darkening all within various colour spaces.
62
+ - **Convolutions**: Sobel filters, blurs, Laplace effects, edge detection, etc.,
63
+ - **Channel manipulation**: Increasing/decreasing RGB channel values, swapping channels, removing channels, etc.
64
+ - **Transform**: Resize, crop, rotate and flip images.
65
+ - **Monochrome effects**: Duotoning, greyscaling of various forms, thresholding, sepia, averaging RGB values
66
+ - **Colour manipulation**: Work with the image in various colour spaces such as HSL, LCh, and sRGB, and adjust the colours accordingly.
67
+ - **Filters**: Over 30 pre-set filters available, incorporating various effects and transformations.
68
+ - **Text**: Apply text to imagery in artistic ways, or to watermark, etc.,
69
+ - **Watermarking**: Watermark images in multiple formats.
70
+ - **Blending**: Blend images together using 10 different techniques, change image backgrounds.
71
+
72
+ ## Install
73
+ ### Native
74
+ Add the following line to the dependencies section of your Rust project's Cargo.toml:
75
+
76
+ ###### Cargo.toml
77
+ ```toml
78
+ [dependencies]
79
+ photon-rs = "0.3.2"
80
+ ```
81
+
82
+ ### Web
83
+ Install Photon as an npm module:
84
+
85
+ ```bash
86
+ npm install --save @silvia-odwyer/photon
87
+ ```
88
+
89
+ ### Node.JS
90
+ To install Photon as an npm module for Node.JS use:
91
+
92
+ ```bash
93
+ npm install --save @silvia-odwyer/photon-node
94
+ ```
95
+
96
+ #### Using Photon Natively
97
+ The following code opens an image from the filesystem, applies an effect, and saves it.
98
+
99
+ Here is a code sample to get you started:
100
+
101
+ ```rs
102
+ extern crate photon_rs;
103
+ use photon_rs::native::{open_image, save_image};
104
+
105
+ fn main() {
106
+ // Open the image (a PhotonImage is returned)
107
+ let mut img = open_image("test_image.png");
108
+
109
+ // Increment the red channel by 40
110
+ photon_rs::channels::alter_red_channel(&mut img, 40);
111
+
112
+ // Write file to filesystem.
113
+ save_image(img, "raw_image.jpg");
114
+
115
+ }
116
+ ```
117
+
118
+ [For more examples, check out the guide on how to get started with Photon natively.](https://silvia-odwyer.github.io/photon/guide/using-photon-natively/)
119
+
120
+ #### Using Photon On The Web
121
+
122
+ ## Modules
123
+ Photon contains a series of modules, which include:
124
+
125
+ - `effects`: Various image effects, including adding offsets, thresholding, duotoning, solarization, etc.,
126
+ - `channels`: Functions related to increasing/decreasing the red, green, and blue channels of the image data.
127
+ - `transform`: Resize, crop, flip, and rotate images.
128
+ - `filters`: Preset filters, which alter the RGB channels of the image. Contains over 20.
129
+ - `conv`: Laplace, Sobel, emboss; image proc functions which require image convolution.
130
+ - `noise`: Noise generation of varying tints and hues.
131
+ - `multiple`: A module for dealing with multiple images, such as watermarking images, etc.,
132
+ - `correction`: Hue rotation, adjusting saturation, lightening/darkening: all techniques available in multiple colour spaces, which lead to varying effects.
133
+
134
+ All effects and filters can be viewed below and on the official website.
135
+
136
+ ### Run Examples
137
+ Clone this crate's official GitHub repo:
138
+ ```sh
139
+ git clone https://github.com/silvia-odwyer/photon
140
+ ```
141
+
142
+ Run the binary, which will perform an image processing function on an image:
143
+ ```sh
144
+ cd crate
145
+ cargo run --release
146
+ ```
147
+
148
+ Compare the original image with the outputted image, and you'll see the desired effect has been applied.
149
+
150
+ ### Got Questions?
151
+ If you'd like to chat to the developer about your potential use case, or have further questions about this library,
152
+ just submit them here, and I'll get back to you!
153
+
154
+ - [Spectrum Chat](https://spectrum.chat/photonlibrary)
155
+ - [Gitter](https://gitter.im/photonlibrary/community)
156
+
157
+ ## License
158
+ This project is licensed under the Apache 2.0 License - see the [LICENSE.md](LICENSE.md) file for details.