mirror of
https://github.com/gradio-app/gradio.git
synced 2025-02-23 11:39:17 +08:00
* chore: update versions * changeset --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
295 lines
12 KiB
Markdown
295 lines
12 KiB
Markdown
# @gradio/imageeditor
|
|
|
|
## 0.5.0
|
|
|
|
### Features
|
|
|
|
- [#8042](https://github.com/gradio-app/gradio/pull/8042) [`92139f3`](https://github.com/gradio-app/gradio/commit/92139f3d7d6b832b649ff1f6c10c87e6fb522cde) - refresh the `ImageEditor` UI. Thanks @pngwn!
|
|
- [#8059](https://github.com/gradio-app/gradio/pull/8059) [`074ce38`](https://github.com/gradio-app/gradio/commit/074ce3805ada6ba829c17da3af5f186d9f5f9865) - ensure the `ImageEditor` works correctly with layers and `change` events. Thanks @pngwn!
|
|
- [#7845](https://github.com/gradio-app/gradio/pull/7845) [`dbb7373`](https://github.com/gradio-app/gradio/commit/dbb7373dde69d4ed2741942b5a1898f8620cec24) - ensure `ImageEditor` events work as expected. Thanks @pngwn!
|
|
|
|
### Fixes
|
|
|
|
- [#8046](https://github.com/gradio-app/gradio/pull/8046) [`d6c289b`](https://github.com/gradio-app/gradio/commit/d6c289b34668f0011676737ee8edb4cb62b0620a) - round [x, y, w, h] before cropping to avoid unexpected interpolation on pixel values. Thanks @ernestchu!
|
|
- [#7959](https://github.com/gradio-app/gradio/pull/7959) [`2a5cb97`](https://github.com/gradio-app/gradio/commit/2a5cb978240960fd8b150a1eae6ae8328a5c0c59) - ensure `ImageEditor` always draws at the correct position. Thanks @hrrbay!
|
|
|
|
### Dependency updates
|
|
|
|
- @gradio/utils@0.3.2
|
|
- @gradio/statustracker@0.4.12
|
|
- @gradio/client@0.16.0
|
|
- @gradio/upload@0.8.5
|
|
- @gradio/atoms@0.7.0
|
|
- @gradio/icons@0.4.0
|
|
- @gradio/image@0.9.12
|
|
|
|
## 0.4.11
|
|
|
|
### Fixes
|
|
|
|
- [#7817](https://github.com/gradio-app/gradio/pull/7817) [`867ff16`](https://github.com/gradio-app/gradio/commit/867ff16cd47ceb5bbf076503538a262b6fe64638) - Trigger the "clear" event of Image Editor. Thanks @uebian!
|
|
|
|
### Dependency updates
|
|
|
|
- @gradio/utils@0.3.1
|
|
- @gradio/atoms@0.6.2
|
|
- @gradio/statustracker@0.4.11
|
|
- @gradio/upload@0.8.4
|
|
- @gradio/image@0.9.11
|
|
- @gradio/client@0.15.1
|
|
|
|
## 0.4.10
|
|
|
|
### Dependency updates
|
|
|
|
- @gradio/upload@0.8.3
|
|
- @gradio/client@0.15.0
|
|
- @gradio/image@0.9.10
|
|
|
|
## 0.4.9
|
|
|
|
### Dependency updates
|
|
|
|
- @gradio/atoms@0.6.1
|
|
- @gradio/statustracker@0.4.10
|
|
- @gradio/icons@0.3.4
|
|
- @gradio/upload@0.8.2
|
|
- @gradio/image@0.9.9
|
|
|
|
## 0.4.8
|
|
|
|
### Dependency updates
|
|
|
|
- @gradio/upload@0.8.1
|
|
- @gradio/statustracker@0.4.9
|
|
- @gradio/wasm@0.10.0
|
|
- @gradio/atoms@0.6.0
|
|
- @gradio/image@0.9.8
|
|
|
|
## 0.4.7
|
|
|
|
### Dependency updates
|
|
|
|
- @gradio/client@0.14.0
|
|
- @gradio/upload@0.8.0
|
|
- @gradio/wasm@0.9.0
|
|
- @gradio/image@0.9.7
|
|
|
|
## 0.4.6
|
|
|
|
### Dependency updates
|
|
|
|
- @gradio/upload@0.7.7
|
|
- @gradio/client@0.13.0
|
|
- @gradio/wasm@0.8.0
|
|
- @gradio/image@0.9.6
|
|
|
|
## 0.4.5
|
|
|
|
### Patch Changes
|
|
|
|
- Updated dependencies [[`8181695`](https://github.com/gradio-app/gradio/commit/8181695e70187e8bc2bf7518697098c8d1b9843d)]:
|
|
- @gradio/upload@0.7.6
|
|
- @gradio/image@0.9.5
|
|
|
|
## 0.4.4
|
|
|
|
### Features
|
|
|
|
- [#7528](https://github.com/gradio-app/gradio/pull/7528) [`eda33b3`](https://github.com/gradio-app/gradio/commit/eda33b3763897a542acf298e523fa493dc655aee) - Refactors `get_fetchable_url_or_file()` to remove it from the frontend. Thanks [@abidlabs](https://github.com/abidlabs)!
|
|
|
|
## 0.4.3
|
|
|
|
### Patch Changes
|
|
|
|
- Updated dependencies [[`98a2719`](https://github.com/gradio-app/gradio/commit/98a2719bfb9c64338caf9009891b6c6b0b33ea89)]:
|
|
- @gradio/statustracker@0.4.8
|
|
- @gradio/image@0.9.3
|
|
|
|
## 0.4.2
|
|
|
|
### Patch Changes
|
|
|
|
- Updated dependencies [[`f191786`](https://github.com/gradio-app/gradio/commit/f1917867916647d383b8d7ce15e0c17f2abbdec1)]:
|
|
- @gradio/icons@0.3.3
|
|
- @gradio/atoms@0.5.3
|
|
- @gradio/image@0.9.2
|
|
- @gradio/statustracker@0.4.7
|
|
- @gradio/upload@0.7.4
|
|
|
|
## 0.4.1
|
|
|
|
### Patch Changes
|
|
|
|
- Updated dependencies [[`065c5b1`](https://github.com/gradio-app/gradio/commit/065c5b163c4badb9d9cbd06d627fb4ba086003e7), [`32b317f`](https://github.com/gradio-app/gradio/commit/32b317f24e3d43f26684bb9f3964f31efd0ea556)]:
|
|
- @gradio/utils@0.3.0
|
|
- @gradio/client@0.12.1
|
|
- @gradio/atoms@0.5.2
|
|
- @gradio/image@0.9.1
|
|
- @gradio/statustracker@0.4.6
|
|
- @gradio/upload@0.7.3
|
|
|
|
## 0.4.0
|
|
|
|
### Features
|
|
|
|
- [#7183](https://github.com/gradio-app/gradio/pull/7183) [`49d9c48`](https://github.com/gradio-app/gradio/commit/49d9c48537aa706bf72628e3640389470138bdc6) - [WIP] Refactor file normalization to be in the backend and remove it from the frontend of each component. Thanks [@abidlabs](https://github.com/abidlabs)!
|
|
|
|
## 0.3.2
|
|
|
|
### Fixes
|
|
|
|
- [#7219](https://github.com/gradio-app/gradio/pull/7219) [`faead14`](https://github.com/gradio-app/gradio/commit/faead1403cdba6415912a6ad512291ac63b04173) - Show label in interactive image editor. Thanks [@hannahblair](https://github.com/hannahblair)!
|
|
|
|
## 0.3.1
|
|
|
|
### Patch Changes
|
|
|
|
- Updated dependencies [[`5727b92`](https://github.com/gradio-app/gradio/commit/5727b92abc8a00a675bfc0a921b38de771af947b), [`bc2cdc1`](https://github.com/gradio-app/gradio/commit/bc2cdc1df95b38025486cf76df4a494b66d98585), [`c60ad4d`](https://github.com/gradio-app/gradio/commit/c60ad4d34ab5b56a89bf6796822977e51e7a4a32), [`be56c76`](https://github.com/gradio-app/gradio/commit/be56c76c7b5d2814ea8239c7dbeddc4b1d3701c4), [`8c355a4`](https://github.com/gradio-app/gradio/commit/8c355a47844296e3aab250fe61e2ecc706122e78)]:
|
|
- @gradio/utils@0.2.1
|
|
- @gradio/upload@0.7.0
|
|
- @gradio/atoms@0.5.0
|
|
- @gradio/wasm@0.5.1
|
|
- @gradio/image@0.7.1
|
|
- @gradio/statustracker@0.4.4
|
|
|
|
## 0.3.0
|
|
|
|
### Fixes
|
|
|
|
- [#6933](https://github.com/gradio-app/gradio/pull/6933) [`9cefd2e`](https://github.com/gradio-app/gradio/commit/9cefd2e90a1d0cc4d3e4e953fc5b9b1a7afb68dd) - Refactor examples so they accept data in the same format as is returned by function, rename `.as_example()` to `.process_example()`. Thanks [@abidlabs](https://github.com/abidlabs)!
|
|
|
|
## 0.2.3
|
|
|
|
### Fixes
|
|
|
|
- [#6885](https://github.com/gradio-app/gradio/pull/6885) [`640b7fe`](https://github.com/gradio-app/gradio/commit/640b7fe05276e11720b4341cadf088491395e53d) - Fix issue with Webcam Recording. Thanks [@dawoodkhan82](https://github.com/dawoodkhan82)!
|
|
|
|
## 0.2.2
|
|
|
|
### Patch Changes
|
|
|
|
- Updated dependencies [[`b1b78c2`](https://github.com/gradio-app/gradio/commit/b1b78c2168e24fb65251a9b9b6cbc9382179a8ca), [`f742d0e`](https://github.com/gradio-app/gradio/commit/f742d0e861c8e25c5d77d9102c9d50f94b0d3383), [`6c863af`](https://github.com/gradio-app/gradio/commit/6c863af92fa9ceb5c638857eb22cc5ddb718d549), [`fb9c6ca`](https://github.com/gradio-app/gradio/commit/fb9c6cacd7ca4598c000f1f97d7d39a8c4463519), [`459c5dc`](https://github.com/gradio-app/gradio/commit/459c5dc989849b1f0134467d260710fe891045d6), [`649cd4d`](https://github.com/gradio-app/gradio/commit/649cd4d68041d11fcbe31f8efa455345ac49fc74), [`8333db8`](https://github.com/gradio-app/gradio/commit/8333db83ac6e2c8511c104534c48137576d0bcd7)]:
|
|
- @gradio/image@0.6.0
|
|
- @gradio/client@0.10.0
|
|
- @gradio/upload@0.5.8
|
|
- @gradio/wasm@0.4.1
|
|
|
|
## 0.2.1
|
|
|
|
### Patch Changes
|
|
|
|
- Updated dependencies [[`d406855`](https://github.com/gradio-app/gradio/commit/d4068557953746662235d595ec435c42ceb24414), [`15c97c6`](https://github.com/gradio-app/gradio/commit/15c97c6d346c475141d20615b5a865e9c44bdc76)]:
|
|
- @gradio/client@0.9.4
|
|
- @gradio/image@0.5.4
|
|
- @gradio/upload@0.5.7
|
|
|
|
## 0.2.0
|
|
|
|
### Features
|
|
|
|
- [#6809](https://github.com/gradio-app/gradio/pull/6809) [`1401d99`](https://github.com/gradio-app/gradio/commit/1401d99ade46d87da75b5f5808a3354c49f1d1ea) - Fix `ImageEditor` interaction story. Thanks [@hannahblair](https://github.com/hannahblair)!
|
|
|
|
## 0.1.5
|
|
|
|
### Fixes
|
|
|
|
- [#6799](https://github.com/gradio-app/gradio/pull/6799) [`c352811`](https://github.com/gradio-app/gradio/commit/c352811f76d4126613ece0a584f8c552fdd8d1f6) - Adds docstrings for `gr.WaveformOptions`, `gr.Brush`, and `gr.Eraser`, fixes examples for `ImageEditor`, and allows individual images to be used as the initial `value` for `ImageEditor`. Thanks [@abidlabs](https://github.com/abidlabs)!
|
|
|
|
## 0.1.4
|
|
|
|
### Patch Changes
|
|
|
|
- Updated dependencies [[`5d51fbc`](https://github.com/gradio-app/gradio/commit/5d51fbce7826da840a2fd4940feb5d9ad6f1bc5a), [`34f9431`](https://github.com/gradio-app/gradio/commit/34f943101bf7dd6b8a8974a6131c1ed7c4a0dac0)]:
|
|
- @gradio/upload@0.5.4
|
|
- @gradio/client@0.9.1
|
|
- @gradio/image@0.5.1
|
|
|
|
## 0.1.3
|
|
|
|
### Patch Changes
|
|
|
|
- Updated dependencies [[`6a9151d`](https://github.com/gradio-app/gradio/commit/6a9151d5c9432c724098da7d88a539aaaf5ffe88), [`21cfb0a`](https://github.com/gradio-app/gradio/commit/21cfb0acc309bb1a392f4d8a8e42f6be864c5978), [`d76bcaa`](https://github.com/gradio-app/gradio/commit/d76bcaaaf0734aaf49a680f94ea9d4d22a602e70), [`67ddd40`](https://github.com/gradio-app/gradio/commit/67ddd40b4b70d3a37cb1637c33620f8d197dbee0), [`053bec9`](https://github.com/gradio-app/gradio/commit/053bec98be1127e083414024e02cf0bebb0b5142), [`bdf81fe`](https://github.com/gradio-app/gradio/commit/bdf81fead86e1d5a29e6b036f1fff677f6480e6b), [`4d1cbbc`](https://github.com/gradio-app/gradio/commit/4d1cbbcf30833ef1de2d2d2710c7492a379a9a00), [`5177132`](https://github.com/gradio-app/gradio/commit/5177132d718c77f6d47869b4334afae6380394cb)]:
|
|
- @gradio/image@0.5.0
|
|
- @gradio/upload@0.5.3
|
|
- @gradio/client@0.9.0
|
|
- @gradio/wasm@0.4.0
|
|
- @gradio/icons@0.3.2
|
|
- @gradio/atoms@0.4.0
|
|
- @gradio/statustracker@0.4.2
|
|
|
|
## 0.1.2
|
|
|
|
### Patch Changes
|
|
|
|
- Updated dependencies [[`b639e04`](https://github.com/gradio-app/gradio/commit/b639e040741e6c0d9104271c81415d7befbd8cf3), [`206af31`](https://github.com/gradio-app/gradio/commit/206af31d7c1a31013364a44e9b40cf8df304ba50)]:
|
|
- @gradio/image@0.4.2
|
|
- @gradio/icons@0.3.1
|
|
- @gradio/atoms@0.3.1
|
|
- @gradio/statustracker@0.4.1
|
|
- @gradio/upload@0.5.2
|
|
|
|
## 0.1.1
|
|
|
|
### Patch Changes
|
|
|
|
- Updated dependencies [[`71f1a1f99`](https://github.com/gradio-app/gradio/commit/71f1a1f9931489d465c2c1302a5c8d768a3cd23a)]:
|
|
- @gradio/client@0.8.2
|
|
- @gradio/image@0.4.1
|
|
- @gradio/upload@0.5.1
|
|
|
|
## 0.1.0
|
|
|
|
### Highlights
|
|
|
|
#### New `ImageEditor` component ([#6169](https://github.com/gradio-app/gradio/pull/6169) [`9caddc17b`](https://github.com/gradio-app/gradio/commit/9caddc17b1dea8da1af8ba724c6a5eab04ce0ed8))
|
|
|
|
A brand new component, completely separate from `Image` that provides simple editing capabilities.
|
|
|
|
- Set background images from file uploads, webcam, or just paste!
|
|
- Crop images with an improved cropping UI. App authors can event set specific crop size, or crop ratios (`1:1`, etc)
|
|
- Paint on top of any image (or no image) and erase any mistakes!
|
|
- The ImageEditor supports layers, confining draw and erase actions to that layer.
|
|
- More flexible access to data. The image component returns a composite image representing the final state of the canvas as well as providing the background and all layers as individual images.
|
|
- Fully customisable. All features can be enabled and disabled. Even the brush color swatches can be customised.
|
|
|
|
<video src="https://user-images.githubusercontent.com/12937446/284027169-31188926-fd16-4a1c-8718-998e7aae4695.mp4" autoplay muted></video>
|
|
|
|
```py
|
|
|
|
def fn(im):
|
|
im["composite"] # the full canvas
|
|
im["background"] # the background image
|
|
im["layers"] # a list of individual layers
|
|
|
|
|
|
im = gr.ImageEditor(
|
|
# decide which sources you'd like to accept
|
|
sources=["upload", "webcam", "clipboard"],
|
|
# set a cropsize constraint, can either be a ratio or a concrete [width, height]
|
|
crop_size="1:1",
|
|
# enable crop (or disable it)
|
|
transforms=["crop"],
|
|
# customise the brush
|
|
brush=Brush(
|
|
default_size="25", # or leave it as 'auto'
|
|
color_mode="fixed", # 'fixed' hides the user swatches and colorpicker, 'defaults' shows it
|
|
default_color="hotpink", # html names are supported
|
|
colors=[
|
|
"rgba(0, 150, 150, 1)", # rgb(a)
|
|
"#fff", # hex rgb
|
|
"hsl(360, 120, 120)" # in fact any valid colorstring
|
|
]
|
|
),
|
|
brush=Eraser(default_size="25")
|
|
)
|
|
|
|
```
|
|
|
|
Thanks [@pngwn](https://github.com/pngwn)!
|
|
|
|
### Fixes
|
|
|
|
- [#6502](https://github.com/gradio-app/gradio/pull/6502) [`070f71c93`](https://github.com/gradio-app/gradio/commit/070f71c933d846ce8e2fe11cdd9bc0f3f897f29f) - Ensure image editor crop and draw cursor works as expected when the scroll position changes. Thanks [@pngwn](https://github.com/pngwn)!
|
|
|
|
# @gradio/image |