Title: | Colorize Old Images Using the 'DeOldify' Image Colorization API |
---|---|
Description: | Call the 'DeOldify' <https://github.com/jantic/DeOldify> image colorization API on 'DeepAI'<https://deepai.org/machine-learning-model/colorizer> to colorize black and white images. |
Authors: | David Zumbach [aut, cre] |
Maintainer: | David Zumbach <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.0 |
Built: | 2025-03-08 05:01:40 UTC |
Source: | https://github.com/zumbov2/colorizer |
clsave
saves images that have been colorized using colorize
or
juxtaposed with juxtapose
.
clsave(response, destfile = "")
clsave(response, destfile = "")
response |
a response object of a |
destfile |
a character string or vector with the name where the images are saved. |
Besides saving, the function returns the response object invisibly.
## Not run: # Save colorized images res <- colorize(img = "https://upload.wikimedia.org/wikipedia/commons/9/9e/Breadfruit.jpg") clsave(res, destfile = "colorized_version.jpg") ## End(Not run)
## Not run: # Save colorized images res <- colorize(img = "https://upload.wikimedia.org/wikipedia/commons/9/9e/Breadfruit.jpg") clsave(res, destfile = "colorized_version.jpg") ## End(Not run)
colorize
calls the DeOldify image colorization API on DeepAI.
colorize( img, key = "quickstart-QUdJIGlzIGNvbWluZy4uLi4K", pane = c("plot", "view", "none") )
colorize( img, key = "quickstart-QUdJIGlzIGNvbWluZy4uLi4K", pane = c("plot", "view", "none") )
img |
path or URL to the images to be colorized. |
key |
DeepAI API key. |
pane |
defines in which pane the image is displayed: |
With the default API key a few queries are possible. After registration on DeepAI https://deepai.org/, around 5000 free requests are currently possible.
A tibble with the file locations of the original images and the response URLs to the colorized images. The latter expire after some time. It is recommended to save the colorized images.
## Not run: # Call image colorization API colorize(img = "https://upload.wikimedia.org/wikipedia/commons/9/9e/Breadfruit.jpg") ## End(Not run)
## Not run: # Call image colorization API colorize(img = "https://upload.wikimedia.org/wikipedia/commons/9/9e/Breadfruit.jpg") ## End(Not run)
colorizer
packageColorize and Restore Old Images Using the 'DeOldify' Image Colorization API on 'DeepAI'
See the README on GitHub
juxtapose
compares the original image with the colorized version obtained with
colorize
.
juxtapose( response, type = c("side-by-side", "stacked", "c-focus", "h-focus", "v-focus", "h-split", "v-split", "d-split", "u-animate", "s-animate"), pane = c("plot", "view", "none") )
juxtapose( response, type = c("side-by-side", "stacked", "c-focus", "h-focus", "v-focus", "h-split", "v-split", "d-split", "u-animate", "s-animate"), pane = c("plot", "view", "none") )
response |
a response object of a |
type |
defines the type of juxtaposition:
|
pane |
defines in which pane the image is displayed: |
The function adds the comparison to the response object and returns it invisibly.
## Not run: # Compare images res <- colorize(img = "https://upload.wikimedia.org/wikipedia/commons/9/9e/Breadfruit.jpg") juxtapose(res) ## End(Not run)
## Not run: # Compare images res <- colorize(img = "https://upload.wikimedia.org/wikipedia/commons/9/9e/Breadfruit.jpg") juxtapose(res) ## End(Not run)