{"id":30023149,"url":"https://github.com/sammycage/plutofilter","last_synced_at":"2025-08-06T04:41:22.314Z","repository":{"id":304488739,"uuid":"1018929860","full_name":"sammycage/plutofilter","owner":"sammycage","description":"A single-header, zero-allocation image filter library in C","archived":false,"fork":false,"pushed_at":"2025-08-01T05:12:04.000Z","size":5791,"stargazers_count":187,"open_issues_count":1,"forks_count":9,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-01T06:30:47.627Z","etag":null,"topics":["blur","color-matrix","grayscale","image-filters","sepia"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sammycage.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,"zenodo":null},"funding":{"github":"sammycage","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":null}},"created_at":"2025-07-13T11:17:00.000Z","updated_at":"2025-08-01T05:12:08.000Z","dependencies_parsed_at":"2025-07-13T13:29:29.424Z","dependency_job_id":null,"html_url":"https://github.com/sammycage/plutofilter","commit_stats":null,"previous_names":["sammycage/plutofilter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sammycage/plutofilter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammycage%2Fplutofilter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammycage%2Fplutofilter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammycage%2Fplutofilter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammycage%2Fplutofilter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sammycage","download_url":"https://codeload.github.com/sammycage/plutofilter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammycage%2Fplutofilter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269022173,"owners_count":24346274,"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","status":"online","status_checked_at":"2025-08-06T02:00:09.910Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["blur","color-matrix","grayscale","image-filters","sepia"],"created_at":"2025-08-06T04:41:17.424Z","updated_at":"2025-08-06T04:41:22.268Z","avatar_url":"https://github.com/sammycage.png","language":"C","funding_links":["https://github.com/sponsors/sammycage"],"categories":["Image Processing"],"sub_categories":[],"readme":"![preview](https://github.com/user-attachments/assets/b701e185-49c6-4f36-818a-110f956e6e0e)\n\n# PlutoFilter\n\nPlutoFilter is a single-header, zero-allocation image filter library written in C. It applies fast, chainable image effects without any dynamic memory allocation. Compatible with SVG and CSS filter semantics, it makes it easy to reproduce visual effects consistently across platforms.\n\n## Installation\n\nPlutoFilter is a self-contained, single-header library written in standard C99. It can be used in two modes: header-only or implementation. In **header-only mode**, simply include the header in any source or header file. This exposes all API declarations but does not include the implementation.\n\nTo include the actual implementation, define `PLUTOFILTER_IMPLEMENTATION` in *one* `.c` or `.cpp` file before including the header:\n\n```c\n#define PLUTOFILTER_IMPLEMENTATION\n#include \"plutofilter.h\"\n```\n\nIn all other source files, include the header as usual:\n\n```c\n#include \"plutofilter.h\"\n```\n\nThe macro `PLUTOFILTER_API` controls the linkage of public functions. By default, it expands to `extern`, but if you define `PLUTOFILTER_BUILD_STATIC` before including the header, all functions will be declared `static` instead. This is useful when embedding the library in a single translation unit to avoid symbol collisions.\n\n## Example\n\n```c\n#define PLUTOFILTER_IMPLEMENTATION\n#include \"plutofilter.h\"\n\n// Replace with real image I/O implementations\nextern plutofilter_surface_t load_image(const char* filename);\nextern void write_image(plutofilter_surface_t surface, const char* filename);\n\nint main(void)\n{\n    plutofilter_surface_t surface = load_image(\"input.jpg\");\n\n    // filter: contrast(97%) hue-rotate(330deg) saturate(111%)\n    plutofilter_color_transform_contrast(surface, surface, 0.97f);\n    plutofilter_color_transform_hue_rotate(surface, surface, 330.0f);\n    plutofilter_color_transform_saturate(surface, surface, 1.11f);\n\n    write_image(surface, \"output.jpg\");\n    return 0;\n}\n```\n\n| `input.jpg` | `output.jpg` |\n| ----------- | ------------ |\n| ![input.jpg](https://github.com/user-attachments/assets/61cd2d2b-785e-4a4c-856b-9ad93199087e) | ![output.jpg](https://github.com/user-attachments/assets/16bed74b-8ddf-436d-94ec-cacdb37401d6) |\n\n## Features\n\n- [Gaussian Blur](#gaussian-blur)\n- [Color Transform](#color-transform)\n  - [Grayscale](#grayscale)\n  - [Sepia](#sepia)\n  - [Saturate](#saturate)\n  - [Brightness](#brightness)\n  - [Contrast](#contrast)\n  - [Opacity](#opacity)\n  - [Invert](#invert)\n  - [Hue Rotate](#hue-rotate)\n  - [Luminance to Alpha](#luminance-to-alpha)\n  - [LinearRGB to sRGB](#linearrgb-to-srgb)\n  - [sRGB to LinearRGB](#srgb-to-linearrgb)\n\n- [Blend](#blend)\n  - [Normal](#blend-normal)\n  - [Multiply](#blend-multiply)\n  - [Screen](#blend-screen)\n  - [Overlay](#blend-overlay)\n  - [Darken](#blend-darken)\n  - [Lighten](#blend-lighten)\n  - [Color Dodge](#blend-color-dodge)\n  - [Color Burn](#blend-color-burn)\n  - [Hard Light](#blend-hard-light)\n  - [Soft Light](#blend-soft-light)\n  - [Difference](#blend-difference)\n  - [Exclusion](#blend-exclusion)\n  - [Hue](#blend-hue)\n  - [Saturation](#blend-saturation)\n  - [Color](#blend-color)\n  - [Luminosity](#blend-luminosity)\n\n- [Composite](#composite)\n  - [Over](#composite-over)\n  - [In](#composite-in)\n  - [Out](#composite-out)\n  - [Atop](#composite-atop)\n  - [Xor](#composite-xor)\n  - [Arithmetic](#arithmetic)\n\n## Roadmap\n\n- [Morphology](https://www.w3.org/TR/SVG11/filters.html#feMorphologyElement)\n- [Diffuse Lighting](https://www.w3.org/TR/SVG11/filters.html#feDiffuseLightingElement)\n- [Specular Lighting](https://www.w3.org/TR/SVG11/filters.html#feSpecularLightingElement)\n- [Convolve Matrix](https://www.w3.org/TR/SVG11/filters.html#feConvolveMatrixElement)\n- [Displacement Map](https://www.w3.org/TR/SVG11/filters.html#feDisplacementMapElement)\n- [Turbulence](https://www.w3.org/TR/SVG11/filters.html#feTurbulenceElement)\n\n## Gaussian Blur\n\n```c\nvoid plutofilter_gaussian_blur(plutofilter_surface_t in, plutofilter_surface_t out, float std_deviation_x, float std_deviation_y);\n````\n\nApplies a Gaussian blur to the input surface using separable convolution. The amount of blur is controlled by the standard deviation along the horizontal and vertical axes. A value of `0` applies no blur.\n\n| `0x0`                                | `5x5`                                | `10x10`                                |\n| ------------------------------------ | ------------------------------------ | -------------------------------------- |\n| ![](tests/zhang-hanyun-blur-0-0.jpg) | ![](tests/zhang-hanyun-blur-5-5.png) | ![](tests/zhang-hanyun-blur-10-10.png) |\n\n## Color Transform\n\n```c\nvoid plutofilter_color_transform(plutofilter_surface_t in, plutofilter_surface_t out, const float matrix[20]);\n````\n\nApplies a 5×4 color transformation matrix to each pixel in the input surface. The matrix operates on color and alpha channels, allowing both isolated and cross-channel transformations. The input and output surfaces may be the same for in-place filtering.\n\n### Example\n\n```c\nconst float original[20] = {\n    1.0f, 0.0f, 0.0f, 0.0f, 0.0f,\n    0.0f, 1.0f, 0.0f, 0.0f, 0.0f,\n    0.0f, 0.0f, 1.0f, 0.0f, 0.0f,\n    0.0f, 0.0f, 0.0f, 1.0f, 0.0f\n};\n\nconst float grayscale[20] = {\n    0.2126f, 0.7152f, 0.0722f, 0.0f, 0.0f,\n    0.2126f, 0.7152f, 0.0722f, 0.0f, 0.0f,\n    0.2126f, 0.7152f, 0.0722f, 0.0f, 0.0f,\n    0.0f,    0.0f,    0.0f,    1.0f, 0.0f\n};\n\nconst float sepia[20] = {\n    0.393f, 0.769f, 0.189f, 0.0f, 0.0f,\n    0.349f, 0.686f, 0.168f, 0.0f, 0.0f,\n    0.272f, 0.534f, 0.131f, 0.0f, 0.0f,\n    0.0f,   0.0f,   0.0f,   1.0f, 0.0f\n};\n\nconst float contrast[20] = {\n    1.75f, 0.0f,  0.0f,  0.0f, -0.375f,\n    0.0f,  1.75f, 0.0f,  0.0f, -0.375f,\n    0.0f,  0.0f,  1.75f, 0.0f, -0.375f,\n    0.0f,  0.0f,  0.0f,  1.0f,   0.0f\n};\n```\n\n| `original` | `grayscale` | `sepia` | `contrast` |\n|------------|-------------|---------|------------|\n| ![](examples/zhang-hanyun.jpg) | ![](tests/zhang-hanyun-grayscale-1.jpg) | ![](tests/zhang-hanyun-sepia-1.jpg) | ![](tests/zhang-hanyun-contrast-1.75.jpg) |\n\n### Grayscale\n\n```c\nvoid plutofilter_color_transform_grayscale(plutofilter_surface_t in, plutofilter_surface_t out, float amount);\n````\n\nApplies a grayscale effect to the input surface, controlled by a blending `amount` between the original color and fully desaturated grayscale. A value of `0` preserves the original image, while `1` results in complete grayscale.\n\n| `0` | `0.25` | `0.5` | `0.75` | `1` |\n|-----|--------|-------|--------|-----|\n| ![](tests/zhang-hanyun-grayscale-0.jpg) | ![](tests/zhang-hanyun-grayscale-0.25.jpg) | ![](tests/zhang-hanyun-grayscale-0.5.jpg) | ![](tests/zhang-hanyun-grayscale-0.75.jpg) | ![](tests/zhang-hanyun-grayscale-1.jpg) |\n\n### Sepia\n\n```c\nvoid plutofilter_color_transform_sepia(plutofilter_surface_t in, plutofilter_surface_t out, float amount);\n````\n\nApplies a sepia tone to the input surface, blending between the original image and a warm, brownish tone. The `amount` controls the intensity, where `0` leaves the image unchanged and `1` applies full sepia coloration.\n\n| `0` | `0.25` | `0.5` | `0.75` | `1` |\n|-----|--------|-------|--------|-----|\n| ![](tests/zhang-hanyun-sepia-0.jpg) | ![](tests/zhang-hanyun-sepia-0.25.jpg) | ![](tests/zhang-hanyun-sepia-0.5.jpg) | ![](tests/zhang-hanyun-sepia-0.75.jpg) | ![](tests/zhang-hanyun-sepia-1.jpg) |\n\n### Saturate\n\n```c\nvoid plutofilter_color_transform_saturate(plutofilter_surface_t in, plutofilter_surface_t out, float amount);\n````\n\nAdjusts the color saturation of the input surface. The `amount` controls how vivid or muted the colors become: `1` leaves the image unchanged, values less than `1` reduce saturation toward grayscale, and values greater than `1` enhance the intensity of colors.\n\n| `1` | `4` | `0.5` | `0` |\n|-----|-----|-------|-----|\n| ![](tests/zhang-hanyun-saturate-1.jpg) | ![](tests/zhang-hanyun-saturate-4.jpg) | ![](tests/zhang-hanyun-saturate-0.5.jpg) | ![](tests/zhang-hanyun-saturate-0.jpg) |\n\n### Contrast\n\n```c\nvoid plutofilter_color_transform_contrast(plutofilter_surface_t in, plutofilter_surface_t out, float amount);\n````\n\nAdjusts the contrast of the input surface. An `amount` of `1` leaves the image unchanged, values below `1` reduce contrast, and values above `1` increase it. The image is scaled around the midpoint of the color range.\n\n| `1` | `1.75` | `0.5` | `0` |\n|-----|--------|-------|-----|\n| ![](tests/zhang-hanyun-contrast-1.jpg) | ![](tests/zhang-hanyun-contrast-1.75.jpg) | ![](tests/zhang-hanyun-contrast-0.5.jpg) | ![](tests/zhang-hanyun-contrast-0.jpg) |\n\n### Brightness\n\n```c\nvoid plutofilter_color_transform_brightness(plutofilter_surface_t in, plutofilter_surface_t out, float amount);\n````\n\nAdjusts the brightness of the input surface. An `amount` of `1` preserves the original brightness, values below `1` darken the image, and values above `1` brighten it uniformly across all color channels.\n\n| `1` | `1.75` | `0.5` | `0` |\n|-----|--------|-------|-----|\n| ![](tests/zhang-hanyun-brightness-1.jpg) | ![](tests/zhang-hanyun-brightness-1.75.jpg) | ![](tests/zhang-hanyun-brightness-0.5.jpg) | ![](tests/zhang-hanyun-brightness-0.jpg) |\n\n### Opacity\n\n```c\nvoid plutofilter_color_transform_opacity(plutofilter_surface_t in, plutofilter_surface_t out, float amount);\n````\n\nAdjusts the opacity (alpha) of the input surface. An `amount` of `1` leaves opacity unchanged, while values between `0` and `1` scale the alpha channel linearly. A value of `0` makes the image fully transparent.\n\n| `1` | `0.75` | `0.5` | `0.25` | `0` |\n|-----|--------|-------|--------|-----|\n| ![](tests/zhang-hanyun-opacity-1.jpg) | ![](tests/zhang-hanyun-opacity-0.75.png) | ![](tests/zhang-hanyun-opacity-0.5.png) | ![](tests/zhang-hanyun-opacity-0.25.png) | ![](tests/zhang-hanyun-opacity-0.png) |\n\n### Invert\n\n```c\nvoid plutofilter_color_transform_invert(plutofilter_surface_t in, plutofilter_surface_t out, float amount);\n````\n\nApplies a color inversion effect to the input surface. The `amount` controls the strength of the inversion: `0` leaves the image unchanged, `1` fully inverts the RGB channels, and intermediate values blend between the original and inverted colors.\n\n| `0` | `0.25` | `0.5` | `0.75` | `1` |\n|-----|--------|-------|--------|-----|\n| ![](tests/zhang-hanyun-invert-0.jpg) | ![](tests/zhang-hanyun-invert-0.25.jpg) | ![](tests/zhang-hanyun-invert-0.5.jpg) | ![](tests/zhang-hanyun-invert-0.75.jpg) | ![](tests/zhang-hanyun-invert-1.jpg) |\n\n### Hue Rotate\n\n```c\nvoid plutofilter_color_transform_hue_rotate(plutofilter_surface_t in, plutofilter_surface_t out, float degrees);\n````\n\nRotates the hue of each pixel in the input surface by the given angle in degrees. The rotation is applied in the RGB color space, preserving luminance and alpha. A value of `0` leaves colors unchanged, while `360` completes a full rotation back to the original.\n\n| `0°` | `30°` | `90°` | `180°` | `270°` | `360°` |\n|------|-------|-------|--------|--------|--------|\n| ![](tests/zhang-hanyun-hue-rotate-0.jpg) | ![](tests/zhang-hanyun-hue-rotate-30.jpg) | ![](tests/zhang-hanyun-hue-rotate-90.jpg) | ![](tests/zhang-hanyun-hue-rotate-180.jpg) | ![](tests/zhang-hanyun-hue-rotate-270.jpg) | ![](tests/zhang-hanyun-hue-rotate-360.jpg) |\n\n## Blend\n\n```c\nvoid plutofilter_blend(plutofilter_surface_t in1, plutofilter_surface_t in2, plutofilter_surface_t out, plutofilter_blend_mode_t mode);\n````\n\nBlends two surfaces using the specified blend mode. The source surface (`in1`) is blended over the backdrop (`in2`), and the result is written to `out`.\n\n| Mode | Input 1 | Input 2 | Output | Explanation |\n| ---- | ------- | ------- | ------ | ----------- |\n| \u003ca id=\"blend-normal\"\u003e\u003c/a\u003eNormal           | ![in1](examples/zhang-hanyun.jpg) | ![in2](examples/royal-purple.png) | ![out](tests/zhang-hanyun-royal-purple-blend-normal.jpg)      | Displays `in1` over `in2` using standard alpha compositing. |\n| \u003ca id=\"blend-multiply\"\u003e\u003c/a\u003eMultiply       | ![in1](examples/zhang-hanyun.jpg) | ![in2](examples/royal-purple.png) | ![out](tests/zhang-hanyun-royal-purple-blend-multiply.jpg)    | Multiplies the colors of `in1` and `in2`, resulting in a darker image.    |\n| \u003ca id=\"blend-screen\"\u003e\u003c/a\u003eScreen           | ![in1](examples/zhang-hanyun.jpg) | ![in2](examples/royal-purple.png) | ![out](tests/zhang-hanyun-royal-purple-blend-screen.jpg)      | Brightens the result by inverting, multiplying, and inverting again.      |\n| \u003ca id=\"blend-overlay\"\u003e\u003c/a\u003eOverlay         | ![in1](examples/zhang-hanyun.jpg) | ![in2](examples/royal-purple.png) | ![out](tests/zhang-hanyun-royal-purple-blend-overlay.jpg)     | Applies Multiply on dark areas and Screen on light areas to add contrast. |\n| \u003ca id=\"blend-darken\"\u003e\u003c/a\u003eDarken           | ![in1](examples/zhang-hanyun.jpg) | ![in2](examples/royal-purple.png) | ![out](tests/zhang-hanyun-royal-purple-blend-darken.jpg)      | Keeps the darker color of each pixel from `in1` or `in2`.                 |\n| \u003ca id=\"blend-lighten\"\u003e\u003c/a\u003eLighten         | ![in1](examples/zhang-hanyun.jpg) | ![in2](examples/royal-purple.png) | ![out](tests/zhang-hanyun-royal-purple-blend-lighten.jpg)     | Keeps the lighter color of each pixel from `in1` or `in2`.                |\n| \u003ca id=\"blend-color-dodge\"\u003e\u003c/a\u003eColor Dodge | ![in1](examples/zhang-hanyun.jpg) | ![in2](examples/royal-purple.png) | ![out](tests/zhang-hanyun-royal-purple-blend-color-dodge.jpg) | Brightens `in2` based on the content of `in1` by dividing by the inverse. |\n| \u003ca id=\"blend-color-burn\"\u003e\u003c/a\u003eColor Burn   | ![in1](examples/zhang-hanyun.jpg) | ![in2](examples/royal-purple.png) | ![out](tests/zhang-hanyun-royal-purple-blend-color-burn.jpg)  | Darkens `in2` based on `in1` by dividing the inverse of `in2` by `in1`.   |\n| \u003ca id=\"blend-hard-light\"\u003e\u003c/a\u003eHard Light   | ![in1](examples/zhang-hanyun.jpg) | ![in2](examples/royal-purple.png) | ![out](tests/zhang-hanyun-royal-purple-blend-hard-light.jpg)  | A strong effect that applies Overlay with `in1` as the source.            |\n| \u003ca id=\"blend-soft-light\"\u003e\u003c/a\u003eSoft Light   | ![in1](examples/zhang-hanyun.jpg) | ![in2](examples/royal-purple.png) | ![out](tests/zhang-hanyun-royal-purple-blend-soft-light.jpg)  | Gently adjusts contrast based on `in1`, giving a softer result.           |\n| \u003ca id=\"blend-difference\"\u003e\u003c/a\u003eDifference   | ![in1](examples/zhang-hanyun.jpg) | ![in2](examples/royal-purple.png) | ![out](tests/zhang-hanyun-royal-purple-blend-difference.jpg)  | Subtracts the darker color from the lighter one at each pixel.            |\n| \u003ca id=\"blend-exclusion\"\u003e\u003c/a\u003eExclusion     | ![in1](examples/zhang-hanyun.jpg) | ![in2](examples/royal-purple.png) | ![out](tests/zhang-hanyun-royal-purple-blend-exclusion.jpg)   | Similar to Difference, but with reduced contrast and softer transitions.  |\n\n## Composite\n\n```c\nvoid plutofilter_composite(plutofilter_surface_t in1, plutofilter_surface_t in2, plutofilter_surface_t out, plutofilter_composite_operator_t op);\n```\n\nComposites two surfaces using a Porter-Duff compositing operator. The source surface (`in1`) is composited over the backdrop (`in2`) using the specified operator. The result is written to `out`.\n\n| Operator | Input 1 | Input 2 | Output | Explanation |\n| -------- | ------- | ------- | ------ | ----------- |\n| \u003ca id=\"composite-over\"\u003e\u003c/a\u003eOver | ![in1](examples/zhang-hanyun.jpg) | ![in2](examples/firebrick-circle.png) | ![out](tests/zhang-hanyun-firebrick-circle-composite-over.jpg) | Draws `in1` over `in2`, preserving transparency. This is the default mode.   |\n| \u003ca id=\"composite-in\"\u003e\u003c/a\u003eIn     | ![in1](examples/zhang-hanyun.jpg) | ![in2](examples/firebrick-circle.png) | ![out](tests/zhang-hanyun-firebrick-circle-composite-in.png)   | Shows the part of `in1` that overlaps with `in2`. Everything else is hidden. |\n| \u003ca id=\"composite-out\"\u003e\u003c/a\u003eOut   | ![in1](examples/zhang-hanyun.jpg) | ![in2](examples/firebrick-circle.png) | ![out](tests/zhang-hanyun-firebrick-circle-composite-out.png)  | Shows the part of `in1` that lies outside `in2`. Removes overlapping areas.  |\n| \u003ca id=\"composite-atop\"\u003e\u003c/a\u003eAtop | ![in1](examples/zhang-hanyun.jpg) | ![in2](examples/firebrick-circle.png) | ![out](tests/zhang-hanyun-firebrick-circle-composite-atop.png) | Keeps the overlapping part of `in1`, but only where `in2` is present.        |\n| \u003ca id=\"composite-xor\"\u003e\u003c/a\u003eXor   | ![in1](examples/zhang-hanyun.jpg) | ![in2](examples/firebrick-circle.png) | ![out](tests/zhang-hanyun-firebrick-circle-composite-xor.png)  | Combines the non-overlapping parts of `in1` and `in2`. Removes the overlap.  |\n\n### Arithmetic\n\n```c\nvoid plutofilter_composite_arithmetic(plutofilter_surface_t in1, plutofilter_surface_t in2, plutofilter_surface_t out, float k1, float k2, float k3, float k4);\n```\n\nBlends two input surfaces using a flexible arithmetic combination of their color values. The output is based on the colors from both inputs, combined according to the four constants: `k1`, `k2`, `k3`, and `k4`.\n\n| Input 1 | Input 2 | k1 | k2 | k3 | k4 | Output |\n|---------|---------|----|----|----|----|--------|\n| ![in1](examples/zhang-hanyun.jpg) | ![in2](examples/firebrick-circle.png) | `0`   | `1`   | `1`   | `0`   | ![out](tests/zhang-hanyun-firebrick-circle-arithmetic-0-1-1-0.jpg) |\n| ![in1](examples/zhang-hanyun.jpg) | ![in2](examples/firebrick-circle.png) | `0.5` | `0.5` | `0.5` | `0`   | ![out](tests/zhang-hanyun-firebrick-circle-arithmetic-0.5-0.5-0.5-0.png) |\n| ![in1](examples/zhang-hanyun.jpg) | ![in2](examples/firebrick-circle.png) | `1`   | `0`   | `0`   | `0`   | ![out](tests/zhang-hanyun-firebrick-circle-arithmetic-1-0-0-0.png) |\n| ![in1](examples/zhang-hanyun.jpg) | ![in2](examples/firebrick-circle.png) | `1`   | `0`   | `0`   | `0.5` | ![out](tests/zhang-hanyun-firebrick-circle-arithmetic-1-0-0-0.5.png) |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsammycage%2Fplutofilter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsammycage%2Fplutofilter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsammycage%2Fplutofilter/lists"}