3
C0D4
2y

For the green dots that keep asking "how do I code this in Python"

https://fanatical.com/en/...

Comments
  • 7
    @bigmonsterlover

    To code green dots out of existence in Python, use the following code:

    ``` python
    image = Image.open("image.png") # Open image
    pixels = image.load() # Load pixel data
    for i in range(image.size[0]): # Iterate over each pixel
    for j in range(image.size[1]):
    if pixels[i,j] == (0,255,0,255): # Check if pixel is green
    pixels[i,j] = (255,255,255,0) # Make pixel transparent

    image.show() # Save and display modified image
    ```

    #python #imageprocessing #colorcorrections
  • 0
    Oy that's the worst code I've ever seen. The comments really make it intolerable, though I guess the python crowd needs them to know what's happening ;P
  • 2
    @spongessuck Actually, that is pretty good tutorial code - it might actually work (if the missing import is added), is concise and comes with noob comments so noobs have an easy time to understand what's going on.
  • 1
    @Oktokolo but it's too simple, it only works if pixels are pure green and there's no comment for that.
  • 1
    @spongessuck It is tutorial code. That stuff is always too simple as it only covers the core essence. But when you see that it doesn't detect all the greens, you can ask ChatGPT another question to fix that (probably doesn't work well here but in a one-on-one session with context-persistence it does).

    You keep using ChatGPT to help you code and sooner or later you actually become a code monkey or dev - depending on how suited your brain is to learn this sort of thing. For a lot of people, AI conversations will become the new uber method of learning things.
  • 0
    @chaosesqueteam2
    Bad code 429. {
    "error": {
    "message": "You exceeded your current quota, please check your plan and billing details.",
    "type": "insufficient_quota",
    "param": null,
    "code": "insufficient_quota"
    }
    }
  • 0
    @chaosesqueteam2
    Bad code 429. {
    "error": {
    "message": "You exceeded your current quota, please check your plan and billing details.",
    "type": "insufficient_quota",
    "param": null,
    "code": "insufficient_quota"
    }
    }
Add Comment