Comments (5)
just composite them as the order you like
remember: the right one is the upper one
from nft-image-generator.
@Fusion4233919 Thanks a lot, let me try.
from nft-image-generator.
@Fusion4233919 Yayy!!!!, It worked. Thanks a lot
from nft-image-generator.
Hi @benyaminahmed, having a similar issue and wondering if you could help me out. Trying alpha.composite 4 images using this code
#### Generate Images
for item in all_images:
im1 = Image.open(f'./trait-layers/backgrounds/{background_files[item["Background"]]}.jpg').convert('RGBA')
im2 = Image.open(f'./trait-layers/elephants/{elephant_files[item["Elephant"]]}.png').convert('RGBA')
im3 = Image.open(f'./trait-layers/hats/{hat_files[item["Hat"]]}.png').convert('RGBA')
im4 = Image.open(f'./trait-layers/smoke/{smoke_files[item["Smoke"]]}.png').convert('RGBA')
#Create each composite
com1 = Image.alpha_composite(im1, im2)
com2 = Image.alpha_composite(im3, im4)
res = Image.alpha_composite(com1, com2)
#Convert to RGB
rgb_im = res.convert('RGB')
file_name = str(item["tokenId"]) + ".png"
rgb_im.save("./images/" + file_name)
And getting this error:
ValueError: images do not match
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
/var/folders/lq/nw0y9p2s6dnglsnqyls1d4qc0000gn/T/ipykernel_8510/2369437489.py in <module>
10 com1 = Image.alpha_composite(im1, im2)
11 com2 = Image.alpha_composite(im3, im4)
---> 12 res = Image.alpha_composite(com1, com2)
13
14 #Convert to RGB
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/PIL/Image.py in alpha_composite(im1, im2)
3042 im1.load()
3043 im2.load()
-> 3044 return im1._new(core.alpha_composite(im1.im, im2.im))
3045
3046
ValueError: images do not match
from nft-image-generator.
Solved 2 images were not the same size 🙃
from nft-image-generator.
Related Issues (20)
- I'm a schoolboy, learning NFC HOT 1
- IMAGES_BASE_URI ="" HOT 1
- editin python code w/ 4 variables HOT 1
- How to change traits-layers HOT 2
- Thankyou HOT 3
- Hi Benjamin! Thank you for Code. HOT 1
- I need a small bit of guidance HOT 2
- Maximum recursion depth reached HOT 1
- How to upload to Opensea with a contract HOT 1
- Composite of more than just two images
- IMAGES_BASE_URI HOT 2
- Recursion error HOT 1
- How to make a layer optional? HOT 2
- Question HOT 2
- The number of weights does not match the population HOT 4
- How to make a layer optional? HOT 3
- How to upload to open sea with metadata HOT 1
- help me please HOT 6
- Modeling
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nft-image-generator.