Coder Social home page Coder Social logo

jalagar / animated-art-engine Goto Github PK

View Code? Open in Web Editor NEW
161.0 161.0 62.0 25.69 MB

A generative engine that takes various png layers on a sprite sheet format, combines them and then converts them into a .gif file

License: MIT License

JavaScript 15.24% Makefile 0.22% Python 7.24% HTML 77.30%

animated-art-engine's People

Contributors

jalagar avatar michapipo avatar pxlsyl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

animated-art-engine's Issues

make first time setup doesn't work

I'm having a trouble getting the 'make' command work. The documents say to "You may have to edit the Makefile to use CHDIR or the equivalent." Can someone possibly help me?

Fixing layers resolution

how can I fix the config on the code to match the layers so that i can generate a whole lot collection

this is the output of the layers.

4
3

Legendary gifs are not included in the preview gif

This is an issue because the preview gif uses the output from step2 which does not include the legendaries. We may have to solve this by using the already generated gifs themselves instead of recreating them from step2.

Can we make an image even if the dna is duplicated?

Hello! jalagar!
I'm back with a question.

Once again, thank you for making a good tool.

I want to make a lot of images and Json files with a small number of cases
Can we create an image with duplicate DNA?

thank you!

artifacts on step3 (pixel art)

Hey there. In step3 where I'm converting the temp folder to gif using gifski, I'm seeing bad-coloured pixels on random frames of the exported gif like this (I'm also setting the quality to 100):

Or this

Step2 runs perfectly and the temp folder looks great. Here's my 8400*400 spreadsheet
spritesheet

Using MichaPipo's script.js to convert to gif doesn't seem to have this issue, but it is a bit slow and has some transparency issues.

Any ideas on what might be causing this 🙁 Or did I miss some configuration parameters for gifski.

Polygon metadata

Hello! Jalagar and thank so much for such Amazing tool and thanks to all in the nft community.
I have probably a very dumb question.

My collection is almost finish by that I mean the code its been running for little over 40 Hours (yes I have an old machine) but I watched I video from hashlips about the minting dapp on polygon and I notice the metadata being little different..
So my question is if you or anyone know the metadata created after running this fork is compatible with Polygon? I'll be selling my collection/nfts on OpenSea, so I'm not using a minting dapp at all (I'll be minting all the nfts), but I just keep watching videos because I want my project to be bugs/errors free.

Now. my understanding is that ETH Metadata and Polygon Metadata are written in the exact same way, and that both should be 100% compatible with each other, but I can be wrong.

Also. Jalagar once I'm finish in the next couple of days I would love to air-drop one NFT to you, so can I send it to the same ETH address you have at the end of the "readme" section?? but again my NFTs would be deployed to the Polygon Blockchain so I'm really not sure. yes I know this are very dumb and basic questions but believe me or not I'm a little head-blocked right now.. I'm very anxious now that I'm getting to close to the deploy stage.

thanks again.

Generate a single .gif, DNA already Exists

I don't understand, I tried the generator a couple of weeks ago and it worked perfectly, now, with the same settings, I gave it another try, and it only generates me a single .gif file and I get lots of messages saying "dna already exists".

I deleted the files, downloaded the zip again from git, nothing..
Any help? Thanks in advance
image

metaplex solana generating error

hey jalagar
after running make step3, I try to run cd ./step2_spritesheet_to_generative_sheet; npm run generate:solana , i tried yarn generate:solana too. but i keep getting errors.
reference pic:
ff98da9595a1a3e3aeac4ed705f10b27

Error at step 2: Looking for layer that doesn't exist

In step2, it appears to be looking for a layer that doesn't exist Background. I have two layers: Animations and Card and step1 is working great. Thank you for this tool by the way!

generator started undefined
(node:9986) [DEP0147] DeprecationWarning: In future versions of Node.js, fs.rmdir(path, { recursive: true }) will be removed. Use fs.rm(path, { recursive: true }) instead
(Use `node --trace-deprecation ...` to show where the warning was created)
node:fs:1413
  handleErrorFromBinding(ctx);
  ^

Error: ENOENT: no such file or directory, scandir '/Users/davidstevens/serif/Generative_Gif_Engine/step1_layers_to_spritesheet/output/Background/'
    at Object.readdirSync (node:fs:1413:3)
    at getElements (/Users/davidstevens/serif/Generative_Gif_Engine/step2_spritesheet_to_generative_sheet/src/main.js:155:6)
    at /Users/davidstevens/serif/Generative_Gif_Engine/step2_spritesheet_to_generative_sheet/src/main.js:255:17
    at Array.map (<anonymous>)
    at layersSetup (/Users/davidstevens/serif/Generative_Gif_Engine/step2_spritesheet_to_generative_sheet/src/main.js:248:30)
    at startCreating (/Users/davidstevens/serif/Generative_Gif_Engine/step2_spritesheet_to_generative_sheet/src/main.js:795:20)
    at Command.<anonymous> (/Users/davidstevens/serif/Generative_Gif_Engine/step2_spritesheet_to_generative_sheet/index.js:36:5)
    at Command.listener [as _actionHandler] (/Users/davidstevens/serif/Generative_Gif_Engine/step2_spritesheet_to_generative_sheet/node_modules/commander/lib/command.js:488:17)
    at /Users/davidstevens/serif/Generative_Gif_Engine/step2_spritesheet_to_generative_sheet/node_modules/commander/lib/command.js:1227:65
    at Command._chainOrCall (/Users/davidstevens/serif/Generative_Gif_Engine/step2_spritesheet_to_generative_sheet/node_modules/commander/lib/command.js:1144:12) {
  errno: -2,
  syscall: 'scandir',
  code: 'ENOENT',
  path: '/Users/davidstevens/serif/Generative_Gif_Engine/step1_layers_to_spritesheet/output/Background/'
}

It does not run in step 1.

python 3.10
node.js v16.14.2
windows 10
Choco & make is imported

image

I enter "make all" and 9009 error is displayed.
Help me. plz!

'MODULE NOT FOUND' Error when using removeTrait.js and provenance.js

inputting either (node utils/removeTrait.js "Trait Name") or (node utils/provenance.js) creates an error code where the module is not found.

I used (node step2_spritesheet_to_generative_sheet/utils/removeTrait.js "Trait Name") to help direct the code; however the same error message came up.

Using (make provenance) created a similar error message.

I don't believe these issues are a problem with the engine but, something I may have missed.

Thanks in advance

Provenance

removeTrait

The system cannot find the path specified.

Whenever I try to run : makestep 2 i get the following error

cd ./step2_spritesheet_to_generative_sheet; npm run generate
The system cannot find the path specified.
make: *** [Makefile:10: step2] Error 1

Im not sure what im supposed to be doing any help would be great!

Solana metadata is a problem.

Hello.
First of all, thank you very much for making useful tools.

After finishing all the steps, I generated the solana data, but the file name is generated incorrectly
If i change the start edition to a different number, the Solana data gets mixed up.

image

plz help me! thank you!

Extra-attributes suggestion!

Hi again,

I don't know if there's a way to code what is in my head lol

But perhaps you noticed there's an "extra-attributes" feature in NFTchef repository, and with that we can add and customize "numbers" traits with the random.math function in many ways.

But is there a way to code a script (or an util script) which gives a specific number value for a given (layer) trait?

Could be great for gaming : rares/legendary NFTs with extra-power, or extra-speed for example!

Duplicate util files between step1 and step3

I can't seem to figure out how to extract the util methods from the two subfolders and create a separate python folder on the global level. I have decided not to spend too much time here in order to get a MVP and given there are only two helper methods, but if someone whose good at Python knows how to do it without getting a "attempted relative import with no known parent package" that would be great! I'd want the file structure to look like:

  • step1
    • build.py (imports from utils/file.py)
  • step2
  • step3
    • build.py (imports from utils/file.py)
  • utils/file.py

Ultra-rares

Hello!

With the already classic NFTchef code, we can add handmade artwork with hand written json files (ultra-rare feature, not "grouping"), and then run the code to mix them with the normal collection. But this feature is not available here for now?

Support for Tezos metadata? =)

Your work is exactly what I had been looking for, thanks! would be great if you could add support/code for tezos metadata as well for sites like OBJKT ? There's very little out there for tezos compared to other networks, this would literally make this an overall solution for just about everything when it comes to generating gifs.. thanks again!

Step 2 : how to use only layerconfigurationgrouping only?

Step 2 : how to use only layerconfigurationgrouping?

I saw your update thank you very much, I am wondering in Step 2 how do I chose a layer configuration ? I wanna use only layerconfigurationgrouping without using layerconfigurationZIindex and layerconfigurationIFthen

shuffleLayerConfigurations: true doesn't work when batching gifs.

Hey! Having some trouble shuffling my gifs when I have multiple configurations. I guess with the nftchef fork I would “shufflelayerconfigurations” but what seems to be happening is it is actually shuffling my batches. So I get one gif with multiple dnas in sequence. Any suggestions how to shuffle these batched gifs? Or if u know of a script that can shuffle gifs and jsons after the fact.

Sprite sheet is too long error

Is there a way to make the spritesheet longer than 32k without getting this error?
Error: invalid value (typically too big) for the size of the input (surface, pattern, etc.)

Metadata Request!

Appreciate what you're creating here; I'm excited to use it. I do have a request tho as I would like to have the SOLANA metadata standard as an option!

DNA Exists, generates a single .gif with all the traits in it

I don't understand, I tried the generator a couple of weeks ago and it worked perfectly, now, with the same settings, I gave it another try, and it only generates me a single .gif file and I get lots of messages saying "dna already exists".

I deleted the files, downloaded the zip again from git, nothing..
Any help? Thanks in advance
image

Utilize multiprocessing in step 3 to dramatically improve performance

Currently step3 is the slowest step of the process. It is also single threaded. However, I see no reason why this step cannot take advantage of multiprocessing to utilize the full performance of the CPU and build many GIFs simultaneously.

As a test, I tried to modify the code myself and was able to build 16 GIFs at a time with my 16 thread CPU. I'll share what I did here, however I am an incredibly novice "developer" (I hesitate to even call myself that) and no prior experience in Python.

Added the following to build.py

import multiprocessing

def generate_gif(filename: str):
    if filename.endswith(".png"):
        print(f"Converting spritesheet to gif for {filename}")
        crop_and_save(
            filename,
        )
        fps = 5
        convert_pngs_to_gif(filename, fps)


def generate_all_gifs(filename: str):
    with multiprocessing.Pool() as pool:
        pool.map(generate_gif, filename)

Note the "fps = 5". I could not figure out how to get the fps variable passed on through to generate_gif (like I said, novice). So I just stuck it in there like that until I can figure out the proper way to do it.

modified main to:

def main():
    print("Starting step 3: Converting sprite sheets to gifs")

    for folder in [output_gifs_directory, output_images_directory, temp_directory]:
        setup_directory(folder)

    generate_all_gifs(sorted(os.listdir(input_directory), key=sort_function))

Generate metadata only

Hello ! Thank you for all the code and explanations.

I already have my .gif ready, and I wonder if it is possible to only duplicate them and generate metadata for each, without doing the whole process. I tried to put them as my input layer but get various errors at phase 2.

Thank you in advance for your help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.