Refactor the way assets are laid out in the assets/ dir and then have a build script that can automatically pixelate/posterize images that I save, saving me tons of time.
This commit is contained in:
parent
3dc70c3af6
commit
dc8648016d
108 changed files with 177 additions and 277 deletions
32
scripts/build_assets.ps1
Normal file
32
scripts/build_assets.ps1
Normal file
|
@ -0,0 +1,32 @@
|
|||
Param (
|
||||
[string]$Colors=16,
|
||||
[string]$Size="256x256"
|
||||
)
|
||||
|
||||
|
||||
function Build-Images {
|
||||
param (
|
||||
[string]$source,
|
||||
[string]$pixel_count
|
||||
)
|
||||
|
||||
$files = Get-ChildItem -Path "C:\Users\lcthw\Pictures\Games\Renders\Raycaster\$source"
|
||||
$out_dir = ".\assets\" + $source.ToLower()
|
||||
mkdir -force $out_dir
|
||||
|
||||
foreach($file in $files) {
|
||||
$in_name = $file.Name
|
||||
$out_file = "$out_dir\$in_name"
|
||||
Write-Output "In file: $in_name"
|
||||
Write-Output "Out file: $out_file"
|
||||
Write-Output "Size: $Size"
|
||||
|
||||
.\scripts\pixelize.ps1 -InFile $file.FullName -OutFile $out_file -Colors $Colors -Pixel $pixel_count -Size $Size
|
||||
}
|
||||
}
|
||||
|
||||
Build-Images -Source "Textures" -pixel_count 12
|
||||
Build-Images -Source "Sprites" -pixel_count 6
|
||||
Build-Images -Source "Items" -pixel_count 2
|
||||
|
||||
cp -recurse C:\Users\lcthw\Pictures\Games\Renders\Raycaster\UI assets\ui
|
|
@ -10,5 +10,7 @@ cp $InFile temp.png
|
|||
# magick temp.png -colors $Colors -quantize sRGB -dither FloydSteinberg color.png
|
||||
|
||||
magick temp.png -posterize $Colors -quantize sRGB -dither FloydSteinberg color.png
|
||||
|
||||
bash ./scripts/magick/pixelize -s $Pixel -m 2 color.png pixels.png
|
||||
|
||||
magick.exe pixels.png -interpolate nearest -interpolative-resize $Size $OutFile
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue