HQ_Images#224
Open
Adam-Kaan-Gambrill wants to merge 98 commits into
Open
Conversation
This script renames PNG files in the specified folder to include the Pokémon's Dex number and name.
I'm trying to rewrite the entire thing and compress it into a function.
Made function that takes all of the Pokédex numbered Pokémon in a folder and renamed them based on their Pokédex number.
Testing a way to list Pokemon based on their dex number, showing their name, type(s) and the average brightness of the image. Also testing making an automatic image brightness finder.
Pokemon types are now read out in a list so it doesn't break if there's an empty space for a single type Pokemon, and doesn't leave out the secondary typing of a dual type Pokemon.
Installed OpenCV to get the image opening working, haven't fully tested it, will make sure it works later.
NOW it can list the mean brightness value of every image in a folder.
I'm working on making my own text file that autofills the Dex number, Pokemon name, their brightness value, and type(s). Need to see if it works, and it does, so next I'll be able to feed it info gathered from my other scripts.
To avoid redundant information, and to keep file size down, before the start of every loop the compilation file will be cleared so the loop itself can rewrite everything fresh.
Made a script that can change the colour of hidden pixels to ensure they are unreadable by my mean colour finder, and it also makes semi-transparent pixels opaque and black so it gives the Pokémon a harder outline.
…mean colour calculations.
…ages into another folder.
…xed colour finder.
It ignores values with 0 opacity so it doesn't give skewed colour values due to the invisible black background.
Trying to make this function closer to the average colour finder, I want to make sure the brightness value isn't tainted by an invisible layer of flat colour. I need to ignore the invisible pixels.
It works, but there's a lot of artifacting with the background, where it'll randomly be all white or all black, or even have patches of the opposite colour and one was even gray. My test works for the most part, but the data is probably unusable, so I'm scrapping it for now.
Changed some of the values so it'd run with the improved function.
All of the brightness values have been updated, they should all be higher because it now ignores the black background which should've been transparent, but the old script didn't care what the opacity was. Also I removed that extra empty tab space after each type, just a little QoL change that is completely invisible but it puts the happy chemicals in my brain anyway.
I want my script to be able to read this log, an ignore every file with a matching name, so it can automatically append to my other list, without having to redo the whole thing from scratch. It's not working yet, and honestly it isn't all that necessary either, it's just something I want to do before Gen 10 comes out.
This script can open an image, convert it into grayscale and alpha channels, and then read its data. It look through every pixel of an image using a loop, any pixels with 0 alpha will be ignored, and every other pixel will have its brightness appended into a list. At the end of the loop, all values in the list are added together, then divided by the length of the list to find the average, then divided by 255 so that the output is between 0 and 1, and then it's rounded to the 3rd decimal place to look neater.
Some mega evolutions and all regional variants have different types than their normal forms, but because they also share the same Pokédex number, they'd copy the normal form's types. I've made a list of every correction, so I can hopefully have my info compiler read from it.
…d Rotom and Oricorio's forms.
It compiles dex number, name, brightness value, types and abilities perfectly fine, but the source of this information - PokeAPI - has inconsistent naming that breaks whenever I request information on Burmy or Oricorio's different forms, which is inconsistent with Rotom and Wormadam's forms which work perfectly fine.
I'm hoping that I can have my code try one URL, and if it fails, use the other version that should work.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
HQ_Images (copy 1).zip