Coder Social home page Coder Social logo

computercraft-stuff's People

Contributors

budak7273 avatar downrightnifty avatar frankiebinns 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

Watchers

 avatar  avatar

computercraft-stuff's Issues

The nfp image hand-painted in the game cannot be converted into a png image

Hello, I am the cc:restitched mod (A derivative of the computercraft mod) users

I used your project to try to convert the in-game hand-drawn nfp (called nft in the cc: restitched mod) to a png image and failed
After researching, I found out the reason. The reason is that the pixels that are not painted in the game will be stored as spaces or the entire line is blank in the nft, so that these transparent colors cannot be displayed when the nft image is converted in your program. Converting to RGB colors will cause the sequence of images to be of different lengths, which will cause PIL to fail to store the image and report an error.

I added the standardize(nfp) function in your code nfp.py
This function will format the incoming nfp string.

  • Fill the number of words in each line with the number of words in the longest line in the nft file
  • spaces will be replaced with 0 (white)

Please consider adding this function to your project if you can.
nfp.txt

The above content was translated using Google Translate

Str object has no attribute 'convert'.

Traceback (most recent call last):
File "D:\projekts\turtle\py.py", line 4, in
nfp.img_to_nfp("t.png")
File "D:\projekts\turtle\nfp.py", line 44, in img_to_nfp
im = _quantize_with_colors(im, CC_COLORS)
File "D:\projekts\turtle\nfp.py", line 89, in _quantize_with_colors
image = image.convert("RGB")
AttributeError: 'str' object has no attribute 'convert'

My python code:

import nfp

nfp.img_to_nfp("t.png")

PIL isn't a module

from PIL import Image

ImportError: No module named PIL

I HAVE PIP INSTALLED PILLOW. I HAVE TRIED SO MUCH STUFF.

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.