Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
geraldb committed Dec 17, 2023
1 parent 565618b commit e5c2d85
Show file tree
Hide file tree
Showing 98 changed files with 247 additions and 0 deletions.
Binary file added attributes/accessories/bandana.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added attributes/accessories/bandana2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added attributes/accessories/cap-burgerking.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added attributes/accessories/cap-mcb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added attributes/accessories/cap-mcd-black.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added attributes/accessories/cap-mcd-red.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added attributes/accessories/cap-mcd-white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added attributes/accessories/cap-subway.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added attributes/accessories/cap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added attributes/accessories/cowboyhat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added attributes/accessories/crown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added attributes/accessories/halo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added attributes/accessories/headband.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added attributes/accessories/knittedcap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added attributes/accessories/knittedcap2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added attributes/accessories/tophat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added attributes/albino.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added attributes/alien.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added attributes/backgrounds/aqua.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added attributes/backgrounds/austria.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added attributes/backgrounds/bitcoin-orange.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added attributes/backgrounds/bitcoin-pattern.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added attributes/backgrounds/blue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added attributes/backgrounds/china.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added attributes/backgrounds/classic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added attributes/backgrounds/default.png
Binary file added attributes/backgrounds/dollar-pattern.png
Binary file added attributes/backgrounds/euro-pattern.png
Binary file added attributes/backgrounds/europe.png
Binary file added attributes/backgrounds/great-britain.png
Binary file added attributes/backgrounds/green.png
Binary file added attributes/backgrounds/rainbow.png
Binary file added attributes/backgrounds/red.png
Binary file added attributes/backgrounds/ukraine.png
Binary file added attributes/backgrounds/usa.png
Binary file added attributes/backgrounds/yellow.png
Binary file added attributes/black.png
Binary file added attributes/brown.png
Binary file added attributes/dark.png
Binary file added attributes/deathbot.png
Binary file added attributes/default.png
Binary file added attributes/demon.png
Binary file added attributes/eyes/3dglasses.png
Binary file added attributes/eyes/eyes-alien.png
Binary file added attributes/eyes/eyes-big-blue.png
Binary file added attributes/eyes/eyes-big.png
Binary file added attributes/eyes/eyes-blend.png
Binary file added attributes/eyes/eyes-blue.png
Binary file added attributes/eyes/eyes-bored.png
Binary file added attributes/eyes/eyes-cool.png
Binary file added attributes/eyes/eyes-demon.png
Binary file added attributes/eyes/eyes-green.png
Binary file added attributes/eyes/eyes-left-blue.png
Binary file added attributes/eyes/eyes-left.png
Binary file added attributes/eyes/eyes-monobrow.png
Binary file added attributes/eyes/eyes-pepe.png
Binary file added attributes/eyes/eyes-polarized.png
Binary file added attributes/eyes/eyes-rainbow.png
Binary file added attributes/eyes/eyes-red.png
Binary file added attributes/eyes/eyes-zombie.png
Binary file added attributes/eyes/lasereyes-blue.png
Binary file added attributes/eyes/lasereyes-gold.png
Binary file added attributes/eyes/lasereyes-green.png
Binary file added attributes/eyes/lasereyes-red.png
Binary file added attributes/eyes/maxibiz-lasereyes-blue.png
Binary file added attributes/eyes/maxibiz-lasereyes-green.png
Binary file added attributes/eyes/maxibiz-lasereyes-red.png
Binary file added attributes/eyes/vr.png
Binary file added attributes/golden-block.png
Binary file added attributes/golden.png
Binary file added attributes/gray-block.png
Binary file added attributes/gray.png
Binary file added attributes/green.png
Binary file added attributes/hair/bob-blonde.png
Binary file added attributes/hair/mohawk-blonde.png
Binary file added attributes/hair/mohawk-purple.png
Binary file added attributes/hair/mohawk-red.png
Binary file added attributes/hair/mohawk.png
Binary file added attributes/hair/mohawk2-green.png
Binary file added attributes/hair/mohawk2-pink.png
Binary file added attributes/hair/mohawk2-red.png
Binary file added attributes/hair/mohawk2.png
Binary file added attributes/hair/peakspike-blonde.png
Binary file added attributes/hair/peakspike-purple.png
Binary file added attributes/hair/peakspike-red.png
Binary file added attributes/hair/peakspike.png
Binary file added attributes/hair/wildhair-blonde.png
Binary file added attributes/hair/wildhair-red.png
Binary file added attributes/hair/wildhair-white.png
Binary file added attributes/hair/wildhair.png
Binary file added attributes/maxibiz.png
Binary file added attributes/memepool.png
Binary file added attributes/pepe.png
Binary file added attributes/pink.png
Binary file added attributes/safemode.png
Binary file added attributes/zombie.png
152 changes: 152 additions & 0 deletions base.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@


ATTRIBUTES = {
backgrounds: [
# solid colors
'aqua',
'blue',
'green',
'red',
'yellow',
'bitcoin-orange',
'classic',
'default',
# currency patterns
'bitcoin-pattern',
'dollar-pattern',
'euro-pattern',
# flags and more
'rainbow',
'ukraine',
'usa',
'austria',
'great-britain',
'china',
'europe',
],
base: [
'maxibiz',
'black',
'default',
'albino',
'brown',
'dark',
'demon',
'golden',
'golden-block',
'gray',
'gray-block',
'green',
'memepool',
'pepe',
'alien',
'deathbot',
'safemode',
'pink',
'zombie',
],
eyes: [
'3dglasses',
'eyes-alien',
'eyes-big',
'eyes-blend',
'eyes-blue',
'eyes-bored',
'eyes-cool',
'eyes-demon',
'eyes-green',
'eyes-left',
'eyes-monobrow',
'eyes-pepe',
'eyes-polarized',
'eyes-rainbow',
'eyes-red',
'eyes-zombie',
'lasereyes-blue',
'lasereyes-gold',
'lasereyes-green',
'lasereyes-red',
'vr',
'eyes-left-blue',
'eyes-big-blue',
'maxibiz-lasereyes-red',
'maxibiz-lasereyes-green',
'maxibiz-lasereyes-blue',
],
accessories: [
'bandana',
'bandana2',
'cowboyhat',
'headband',
'knittedcap',
'knittedcap2',
'tophat',
'cap',
'cap-mcb',
'cap-mcd-red',
'cap-mcd-white',
'cap-mcd-black',
'cap-burgerking',
'cap-subway',
'crown',
'halo',
],
hair: [
'mohawk',
'mohawk-blonde',
'mohawk-purple',
'mohawk-red',
'mohawk2',
'mohawk2-green',
'mohawk2-pink',
'mohawk2-red',
'peakspike',
'peakspike-blonde',
'peakspike-purple',
'peakspike-red',
'wildhair',
'wildhair-blonde',
'wildhair-red',
'wildhair-white',
'bob-blonde',
],
}.reduce( {} ) do |h,(category, names)|
names.each do |name|
key = File.basename( name ).downcase.gsub( /[^a-z0-9]/, '' )

## fix-up names by category
key = "bg#{key}" if category == :backgrounds

## fix-up file path by category
path = category == :base ? name : "#{category}/#{name}"

puts " #{key} / #{category}"
if h.has_key?( key )
puts "!! ERROR - duplicate key >#{key}<; already in use; sorry"
exit 1
end

h[ key ] = Image.read( "./attributes/#{path}.png" )
end
h
end




def generate( *attributes )
base = Image.new( 28,28 )
attributes.each do |attrib|
key = attrib.downcase.gsub( /[^a-z0-9]/, '' )
img = ATTRIBUTES[ key ]
if img.nil?
puts "!! #{attrib} with key #{key} not found; sorry"
exit 1
end
base.compose!( img )
end
base
end



95 changes: 95 additions & 0 deletions generate_sample.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
require 'pixelart'


require_relative 'base'



specs = parse_data( <<DATA )
## archetypes
maxibiz
black
default
albino
brown
dark
demon
golden-block
golden
pink
gray-block
gray
green
memepool
pepe
alien
deathbot
safemode
zombie
maxibiz, vr, mohawk
black, vr, mohawk-purple
default, vr, mohawk-blonde
albino, vr, mohawk-red
brown, vr, mohawk2
dark, vr, mohawk2-green
demon, vr, halo
golden-block, vr
golden, vr, crown
pink, bob-blonde, vr
pink, bob-blonde
pink, bob-blonde, eyes-left-blue
gray-block, vr
gray, vr, mohawk2-pink
green, vr, mohawk2-red
memepool, vr, peakspike
pepe, vr, peakspike-blonde
alien, vr, peakspike-purple
deathbot, vr, wildhair-red
safemode, vr, wildhair
zombie, vr, mohawk-red
maxibiz, lasereyes red, tophat
black, 3dglasses, knittedcap
default, eyes-big, headband
albino, eyes-blend, cap
brown, eyes-blue, bandana
dark, eyes-zombie, cap mcd red
demon, eyes-cool, cap mcd black
golden-block, eyes-rainbow
golden, eyes-rainbow, crown
pink, wildhair-blonde, eyes-cool
gray-block, eyes-pepe
gray, eyes-polarized, cap subway
green, lasereyes gold, cap burgerking
memepool, eyes-big, knittedcap2
pepe, eyes-red, cap mcb
alien, eyes-blue, cap mcd white
deathbot, 3dglasses, cowboyhat
safemode, eyes-bored, bandana2
zombie, eyes-red, bandana
DATA



cols = 10
rows = specs.size / cols
rows += 1 if specs.size % cols != 0

composite = ImageComposite.new( cols, rows,
width: 28, height: 28 )

specs.each_with_index do |spec, i|
img = generate( *spec)
img.save( "./tmp/rock#{i}.png" )
img.zoom(10).save( "./tmp/rock#{i}@10x.png" )
composite << img
end


composite.save( "./tmp/rocks.png" )
composite.zoom(4).save( "./tmp/[email protected]" )

puts "bye"

0 comments on commit e5c2d85

Please sign in to comment.