https://github.com/pgomba/pixelize
Some silly code to reduce image size by averaging groups of pixels, creating a pixelated effect in the resulting image.
https://github.com/pgomba/pixelize
Last synced: about 1 year ago
JSON representation
Some silly code to reduce image size by averaging groups of pixels, creating a pixelated effect in the resulting image.
- Host: GitHub
- URL: https://github.com/pgomba/pixelize
- Owner: pgomba
- Created: 2024-12-08T15:50:37.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-08T16:14:23.000Z (over 1 year ago)
- Last Synced: 2025-02-06T18:52:31.816Z (over 1 year ago)
- Language: R
- Homepage:
- Size: 1.55 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pixelize
Some silly code to reduce image size by averaging groups of pixels, creating a pixelated effect in the resulting image.
Function `pixelize()` requires an image path and a number of block.
Examples:
```
image_path <- "images/fraggle.png"
a<- pixelize(image_path,1)
b<- pixelize(image_path,10)
c<- pixelize(image_path,20)
d<- pixelize(image_path,40)
e<- pixelize(image_path,60)
f<- pixelize(image_path,90)
a+b+c+d+e+f+ plot_layout(ncol = 6) +
theme(plot.margin = margin(0, 0, 0, 0))
```

```
image_path <- "images/mario.jpg"
a<- pixelize(image_path,1)
b<- pixelize(image_path,10)
c<- pixelize(image_path,20)
d<- pixelize(image_path,40)
e<- pixelize(image_path,60)
f<- pixelize(image_path,90)
a+b+c+d+e+f+ plot_layout(ncol = 6) +
theme(plot.margin = margin(0, 0, 0, 0))
```
