Browse Source

Add a few missing pokemone and refactor anim_ingest

Kirk Trombley 3 năm trước cách đây
mục cha
commit
f105948a47
2 tập tin đã thay đổi với 13 bổ sung6 xóa
  1. 11 6
      anim_ingest.py
  2. 2 0
      database-anim.js

+ 11 - 6
anim_ingest.py

@@ -52,7 +52,7 @@ full_filters = [
 ]
 
 # force certain pokemon to stay
-force_keep = [ "meowstic-f.gif" ]
+force_keep = [ "meowstic-f.gif", "unfezant-f.gif", "pyroar-f.gif" ]
 
 # rename certain pokemon after the fact
 rename = {
@@ -92,6 +92,7 @@ rename = {
   "basculin": "basculin-redstriped",
   "meowstic": "meowstic-male",
   "meowstic-f": "meowstic-female",
+  "pyroar-f": "pyroar-female",
   "flabebe": "flabebe-red",
   "floette": "floette-red",
   "florges": "florges-red",
@@ -142,6 +143,14 @@ def get_all_pixels(im: Image) -> list[tuple[int, int, int]]:
   return rgb_pixels
 
 
+def calc_stats(name: str) -> list[float]:
+  front = get_all_pixels(load_image(base, name))
+  back = get_all_pixels(load_image(back_base, name))
+  rgb_pixels = np.array(front + back)
+  jab_pixels = cspace_convert(rgb_pixels, "sRGB255", "CAM02-UCS")
+  return [len(rgb_pixels), *ingest.all_stats(jab_pixels), *ingest.all_stats(rgb_pixels)]
+
+
 if __name__ == "__main__":
   pkmn = get_all_pokemon()
   print("Found", len(pkmn), "sprites...")
@@ -151,11 +160,7 @@ if __name__ == "__main__":
     for name in pkmn:
       print("Ingesting", name, "...")
       try:
-        front = get_all_pixels(load_image(base, name))
-        back = get_all_pixels(load_image(back_base, name))
-        rgb_pixels = np.array(front + back)
-        jab_pixels = cspace_convert(rgb_pixels, "sRGB255", "CAM02-UCS")
-        stats = [len(rgb_pixels), *ingest.all_stats(jab_pixels), *ingest.all_stats(rgb_pixels)]
+        stats = calc_stats(name)
         outfile.write(f'  [ "{rename.get(name, name)}", {", ".join(str(n) for n in stats)} ],\n')
       except Exception as e:
         print(e)

+ 2 - 0
database-anim.js

@@ -739,6 +739,7 @@ const databaseV2 = [
   [ "purrloin", 145741, 2056.8495502615024, 38.80327112491518, 6.397579819824736, -6.240454821981282, 0.9482228792286099, 0.1700878992307697, -0.18907391795887327, 75961.0, 2170.6676049167145, 42.89352582247664, 10.451548028798822, -11.589862121447975, 0.933737849876484, 0.2258139445362424, -0.25767755419349747, 16606.0, 6574.536565893331, 79.47696820227598, -1.5674191029661044, 10.132201861814897, 0.9897566282781932, -0.01974351718038849, 0.12843434129006764, 53174.0, 483.4030570247418, 20.257981119464922, 3.093771435832331, -3.7117379493708618, 0.9559444701948553, 0.1497647031847089, -0.19022751447354957, 33366.36539477566, 98.91196711975354, 80.79238512155125, 99.80752842371055, 0.5996608803546998, 0.49270822133678865, 0.6226557708547018, 74774.0, 34429.27490839062, 108.89075079573114, 84.71896648567684, 120.78892395752534, 0.5934348238518311, 0.46031453985212906, 0.6569943115855751, 53174.0, 6843.965490653327, 47.392090119231206, 41.267028999134915, 48.76881558656486, 0.5911897110011902, 0.5169040103020103, 0.6140888650181763, 17793.0, 108161.1777665374, 210.94278648906874, 182.41184735570167, 164.16259203057382, 0.6511414124835736, 0.5565320990902511, 0.5039521574310875 ],
   [ "purugly", 539051, 3662.8971273796674, 54.977915364820035, -0.7831436597725099, -5.207084730024629, 0.9891229707281385, -0.01673054498924812, -0.11221858881405697, 113169.0, 8439.181348489396, 91.39791762431452, -0.6505237045427176, 0.42013135216796577, 0.9984993011575869, -0.006270140893864173, 0.00459558177384049, 134413.0, 613.0844576274188, 23.56561009581065, -0.2315327929064731, -2.9380937330654167, 0.9909498126800925, -0.014327384804668714, -0.12642282822992965, 291469.0, 3214.846601789006, 55.323087414970225, -1.0890154305644937, -8.438331633393046, 0.9846399511082058, -0.02190025237132561, -0.15102377371880432, 63281.19781245189, 127.4745487903742, 128.0241646894264, 137.21870657878384, 0.556733321730893, 0.5624976883037965, 0.6093795208427154, 99075.0, 165144.8968660106, 237.96411809235428, 233.12927580116073, 230.4690890739339, 0.5881101358241045, 0.5744714892076681, 0.5679843312236695, 134413.0, 8991.902263917924, 51.02952839383095, 51.046743990536626, 54.68528341752658, 0.5623034623950804, 0.5644718458764707, 0.6041194058360911, 305563.0, 54134.28244257322, 125.27680380150738, 127.80645889718323, 143.28875878296785, 0.5441095512701627, 0.5577469273595778, 0.6251152488243725 ],
   [ "pyroar", 578254, 3387.9905028898092, 51.111801190742476, 11.395760770628817, 10.519977819707083, 0.9393705608052126, 0.20466472219572981, 0.1791842830792617, 187962.0, 5459.741242904678, 71.48605734471722, 4.197252336951628, 14.593906175945264, 0.9763195553529944, 0.05541247173710496, 0.19592131122043366, 209866.0, 1075.7098843561075, 30.419742193968172, 3.8145189645482973, 3.756392503152867, 0.9711511150273372, 0.13019022791842938, 0.1212247926275572, 180426.0, 3919.2812907956904, 53.95492645020046, 27.713203573010507, 14.143085766430962, 0.8639121196457616, 0.4467773651460727, 0.22916489086370873, 46770.027856270775, 154.08956444745735, 97.85888035361623, 77.21725400948372, 0.7528758049792347, 0.48610429179553366, 0.39994116523123385, 258953.0, 67451.04981985148, 212.51586195178277, 108.51003463949057, 80.1780593389534, 0.847850415359162, 0.4057404640700143, 0.3068836354219192, 204381.0, 42576.482510605194, 132.3700050396074, 115.89308693078124, 96.16440373615943, 0.6582930610938296, 0.5738236721259907, 0.4855635673383521, 114920.0, 7626.870100939785, 61.06311347024017, 41.78511138183084, 36.84876435781413, 0.7070783415018119, 0.5111850402289285, 0.4573544470817331 ],
+  [ "pyroar-female", 402855, 3378.589698325281, 51.84025091753963, 6.952950299061467, 9.019495562144689, 0.9644124442588684, 0.12930481191699325, 0.1568552689546912, 144047.0, 878.5161122803239, 28.245669293209012, 2.8039570524786774, 3.4436103875541386, 0.985085449313291, 0.09413884851326387, 0.12060315190826632, 159803.0, 5643.374757789814, 73.16492703959727, 2.582651257617537, 12.788262235178385, 0.9833065143934464, 0.034798081043370566, 0.1713131517025408, 99005.0, 3360.496197933257, 51.74915936461954, 20.043571256709814, 11.04898206372238, 0.9038375899802276, 0.3330118029217327, 0.18626384091940731, 48670.71811197577, 144.63253527944298, 108.25043502004443, 87.10848320115178, 0.7055750306656288, 0.5307608535775321, 0.4416739802208579, 144047.0, 12245.651849743486, 70.2888432247808, 59.38543669774449, 53.42908217456802, 0.6583637367071005, 0.5586641392795101, 0.5014424948373898, 190266.0, 76318.87588428831, 182.12037358224802, 158.16009691694785, 121.4845584602609, 0.6712999336867036, 0.582384754828433, 0.4535847707420196, 68542.0, 48472.54959003239, 196.80966414753, 72.40007586589245, 62.464007469872485, 0.8999380615629958, 0.32881667641472484, 0.28300201713346 ],
   [ "pyukumuku", 137693, 2055.9396887367257, 38.85418395497855, 2.2745527796622014, -2.105839798661656, 0.9545938598837636, -0.015572377859557422, -0.06670835481182472, 34447.0, 5289.456239994903, 66.68929824449077, 21.595983368766788, -1.37669042312378, 0.9260156721501649, 0.32379939931997265, -0.02127417837370921, 93272.0, 1012.9080473177809, 30.41227164729008, -5.783082092107827, -2.424831480201611, 0.9714457834575424, -0.18798527536503482, -0.08231965292217053, 9974.0, 642.3345771775691, 21.66527908568872, 10.895607547727918, -1.6410329426818568, 0.8957027647586489, 0.4246678635315234, -0.07763416977193213, 32541.837551654768, 96.03653054258386, 79.98228668124015, 91.07024322224078, 0.5627459609663019, 0.5408810575209383, 0.5927663193979279, 29765.0, 75929.50068872837, 206.83987905257854, 99.3417436586595, 143.48483117755754, 0.7582610566323266, 0.3656187337057107, 0.5292332763632938, 102511.0, 13073.428149174235, 56.65935363034211, 66.37237954951176, 68.32218005872541, 0.5052062900631104, 0.5900179079456682, 0.6118555384167476, 5417.0, 162557.03470555658, 232.37253092117408, 231.1602362931512, 233.54882776444526, 0.577319042280546, 0.5740387821849147, 0.5806204997771259 ],
   [ "quagsire", 462172, 5067.764910461489, 66.52926190661121, -8.731971669634767, -10.57432124639367, 0.97317678798729, -0.12705630256350817, -0.16207963321282048, 349883.0, 6239.172919097208, 76.99290046086941, -10.892955282299607, -11.264502762675008, 0.9795137437265622, -0.1391558196534195, -0.14451467555113093, 84780.0, 1762.8542799752338, 39.099726581818075, -2.035996127828281, -10.259573642257692, 0.9467212244056443, -0.08009201209286047, -0.2417495271331538, 27509.0, 354.2011665094064, 17.978851370609064, -1.8830632065244903, -2.7660229593254178, 0.9741113765330245, -0.11790356012111589, -0.13995111072956795, 85132.40630111733, 131.87022580338055, 163.17374700328017, 181.3351609357555, 0.47628319249466583, 0.5855505942665534, 0.6536906342963872, 216108.0, 76798.26092972033, 131.73058840949895, 159.83041349695523, 181.15447831639736, 0.48103639396658915, 0.5755090807041368, 0.6590056826132256, 165783.0, 130673.16886532395, 170.9790087041494, 214.66197378500812, 234.4530319755343, 0.4733011639887885, 0.5945257786953322, 0.6498925049778861, 80281.0, 13523.822050049203, 51.48514592493866, 65.8487064187043, 72.13132621666396, 0.4696460650175175, 0.594047230012429, 0.6472263502297972 ],
   [ "quilava", 158112, 3331.920316028143, 50.42292406176461, -5.7197190845789025, 2.4024855156334266, 0.9381558913573252, -0.15739125945614815, -0.010612086395604674, 95741.0, 1452.8890780051518, 33.3899724646275, -10.701933665059336, -5.391688395312644, 0.9118691242207827, -0.27919462071276263, -0.13919414927749404, 44663.0, 5242.891742692247, 70.52822307863546, 2.9004126131689882, 14.054580751875625, 0.9753483975819218, 0.04344182374397379, 0.19613340212544342, 17708.0, 8671.349553139056, 91.80472036139875, -0.5242557836489259, 15.154037067004175, 0.9864726107455438, -0.005382697500333696, 0.1631343292678712, 47202.48368245294, 102.70200870269176, 119.62073719894758, 102.37916160696216, 0.46273547672414633, 0.6178689396831366, 0.5683675759024656, 48712.0, 25566.952845294792, 33.406121694859586, 105.01909180489407, 115.2316061750698, 0.2094552974888596, 0.6585333820103172, 0.7227789705952515, 62371.0, 92842.5440669542, 202.9355630020362, 178.7128954161389, 129.2597841945776, 0.680118546537905, 0.5913446509550199, 0.4257287520665341, 47029.0, 9083.318314231645, 41.54557826022241, 56.37547045440048, 53.41704054944821, 0.4367809517194712, 0.6109264169308728, 0.5976014150940382 ],
@@ -981,6 +982,7 @@ const databaseV2 = [
   [ "tyrunt", 349128, 2030.0127173603896, 40.54585838656191, 3.1701996616119144, 4.2331036741382935, 0.9854989313481292, 0.08861138261831483, 0.11763657416777513, 228836.0, 1863.0082282985447, 41.74296506748509, 4.160496800622961, 5.343515400059466, 0.9832817649982099, 0.10396308061518068, 0.1337528264153365, 37964.0, 6629.594529474195, 80.56876851676918, 0.7115336174525777, 2.028654821245314, 0.9962010071238866, 0.00955199152665878, 0.025955984996352047, 82328.0, 373.2023410914529, 18.762614963416837, 1.5513720646574882, 2.16318236593004, 0.9867266287834455, 0.0823970880962705, 0.1151171784333878, 31178.905080658096, 102.48677848811897, 88.31641690153755, 79.8083825989322, 0.6598263261013478, 0.5588116237151796, 0.4981021191581597, 208376.0, 12397.068539563097, 72.94112085844819, 58.99052674012362, 50.594603025300415, 0.6769156600486874, 0.5547087631922683, 0.48110395748650364, 33010.0, 122052.48697364435, 207.70642229627384, 198.5262950621024, 192.24553165707363, 0.6006035573469828, 0.5725271193015373, 0.5533725115551247, 107742.0, 39661.64192237011, 127.39169497503295, 111.26738876204266, 101.86013810770173, 0.6449197580597099, 0.5625445148328482, 0.5140432867966637 ],
   [ "umbreon", 241721, 1887.2041983741715, 37.335485803478164, -4.846680528391875, 0.14585148135861567, 0.9828216819948702, -0.13299910147588428, -0.029941253184369646, 93174.0, 1682.3518236247237, 39.9626739479073, -6.061850312337577, -4.271557352980003, 0.9809153785422468, -0.15091452102621705, -0.10572822972680049, 21027.0, 9861.61825477265, 95.35672314060857, -5.923628113118206, 26.048534392452193, 0.961731086920656, -0.05915478403229603, 0.2609805886116248, 127520.0, 721.9666732929813, 25.848674435730615, -3.781222511532521, -0.8976559123094573, 0.9876922110087896, -0.13208530882967964, -0.02253722099424397, 26433.590333483644, 79.25893075074156, 87.52084841614919, 77.02070568961737, 0.5389107957547224, 0.6044335523256862, 0.5763397593921068, 168147.0, 19139.060881252713, 69.50441577905048, 81.96272904066085, 83.9307510690051, 0.5094162645354491, 0.6015845218810215, 0.6143284839805465, 21601.0, 134957.7790380075, 248.74482662839682, 241.69135688162586, 113.4388685708995, 0.678271653101922, 0.6582512891773132, 0.3106878077915936, 51973.0, 4928.621284128298, 40.37581051699921, 41.426606122409716, 39.52869759298097, 0.5764126344259956, 0.591283243295496, 0.563845920925471 ],
   [ "unfezant", 239539, 2195.333573442234, 41.97449643194703, -1.1920392728595417, 0.2995107806202845, 0.9804511006882453, -0.0282714987204212, 0.002685035253394062, 117460.0, 694.682221630501, 24.97916974466155, 0.4259956580866996, -0.47696707720871356, 0.9872640857393988, 0.0029409728909903033, -0.017596898790493122, 28342.0, 2796.515942105955, 48.232316930172765, -19.350356948705, 7.834831411698534, 0.9163082662379407, -0.36825997317126935, 0.14989192147719427, 93737.0, 3893.99895733271, 61.378914368469175, 2.2707198999256324, -1.0058538901652028, 0.9913078913891904, 0.03541452096657768, -0.016409042822046634, 32237.200230442642, 91.3159902980308, 94.63892727280317, 91.53157105940996, 0.5586228242291614, 0.587120191841631, 0.5650432688369563, 51204.0, 23363.92391219436, 63.099210999140695, 105.53255605030857, 84.449203187251, 0.42483057442457056, 0.6878163904443433, 0.5564540808178349, 93737.0, 62195.08072586065, 148.97817297331898, 136.80516764991413, 139.9714627094957, 0.6017284058727691, 0.553726547333355, 0.5665217204367756, 94598.0, 7354.913042559039, 49.45180659210554, 46.95996744117212, 47.366107105858475, 0.5883286367489151, 0.5657050657521782, 0.5682274288184616 ],
+  [ "unfezant-f", 205903, 2213.2001392994753, 42.46126597211954, 0.6404650293383336, -0.0007293510956287205, 0.976120682828041, 0.01860354281623344, -0.003121867592389226, 114645.0, 980.6880507226053, 29.1141803413434, 1.875038233972827, 2.663613869977245, 0.9805703349721183, 0.05308879522065997, 0.06406361373432766, 83602.0, 4042.0368781519005, 63.04937746216256, -0.40853679220418215, -1.9415616859287081, 0.9987922522198635, -0.004860614237867847, -0.03066471788906377, 7656.0, 698.9550182702019, 17.509507266964864, -6.391796564291018, -18.704512491536043, 0.6619201976681854, -0.2415729597780603, -0.7084304015783708, 34118.98859657217, 99.12675871648301, 94.70730392466355, 92.63939816321277, 0.5910947377278871, 0.5620339255892557, 0.5506705296831605, 121268.0, 12694.021489593297, 66.42863739815945, 59.87155721212521, 55.23852953788304, 0.5996206025637467, 0.5546844134875516, 0.5305973596067682, 36829.0, 81040.07752043227, 162.86154932254473, 163.275842406799, 165.22134730782807, 0.573142858502667, 0.5745811502265522, 0.5827211618296483, 47806.0, 52319.76103417981, 132.9707777266452, 130.24992678743254, 131.59701711082292, 0.5832972893560177, 0.5710110183665653, 0.5768982094182481 ],
   [ "unown", 122564, 1002.2390983436981, 24.597098440366068, -2.5991354880773665, -5.789841746325965, 0.9396378493661435, -0.12739575682127918, -0.28078672567991064, 73216.0, 302.2874711003945, 15.492528419103971, -2.613771439957429, -6.236629593405678, 0.9133152959771363, -0.15820742367906146, -0.37324855480651875, 34081.0, 576.1549197939418, 22.765337948936626, -2.6380317080075057, -4.232942002870178, 0.9716071088647009, -0.10318641658142401, -0.16380477785748765, 15267.0, 5310.160315974184, 72.34900962013242, -2.442116563302181, -7.122695689100247, 0.994507027066044, -0.03367541386311608, -0.09850968909116244, 15726.55681929441, 49.17536960281975, 55.13961685323586, 62.57809797330374, 0.4849296910886077, 0.5661994396878453, 0.6635768274207886, 93949.0, 4187.082236106824, 29.896199001585966, 35.25931090272382, 41.891707202844096, 0.4745139178905476, 0.563704267605351, 0.6734423938577492, 15267.0, 90109.03196436759, 164.95853802318726, 170.78738455492237, 182.45405122158905, 0.5506445140968278, 0.5702671605416975, 0.6095546477100322, 13348.0, 11870.162571171712, 52.44156427929278, 62.79172909799221, 71.06772550194786, 0.4830779734716216, 0.5791090162310376, 0.6559274804348568 ],
   [ "ursaring", 381041, 2621.046161375366, 46.11359325898235, 8.239846032339651, 10.78566188157317, 0.9513862296246691, 0.18345876504099934, 0.22402508291954398, 312999.0, 3053.98945459441, 51.16861987955505, 9.295077233267602, 12.145870319124992, 0.9511245713776583, 0.19002123141002786, 0.2307782217109761, 13308.0, 1437.5381657868757, 36.86180619083323, 1.3822996901270195, 4.660302224200779, 0.9734040190487122, 0.03667495407615443, 0.12444298774737682, 54734.0, 432.99680578670944, 19.455656786271287, 3.872796594312477, 4.496561972472034, 0.9475291394927408, 0.18161993625700631, 0.20961928092424084, 35991.99138150488, 132.8316532866542, 94.26134720410664, 68.54208864662859, 0.752566448136416, 0.5254644833788964, 0.388884425171266, 119871.0, 66036.51839060323, 182.250319093025, 138.50761234994286, 98.09650374152214, 0.739448818416064, 0.5449647649912958, 0.3881429681125773, 55153.0, 5299.1511975776475, 51.73283411600457, 38.46008376697551, 31.03080521458488, 0.7160997599071077, 0.5343961441790482, 0.43524879725658316, 206017.0, 26727.390487192806, 125.78843978894946, 83.45526340059315, 61.38803108481339, 0.7699614720838436, 0.5117271406082602, 0.37690359342151164 ],
   [ "urshifu-rapid-strike", 720262, 2062.700838159316, 36.92891751664472, -2.966440175661499, -0.28092161030383767, 0.9824678489390312, -0.12512670122819208, 0.005451179374816292, 279293.0, 674.0825494498683, 24.33528246288903, -3.2582870541338536, 0.2551479469980303, 0.9764509325716535, -0.15713358748024617, 0.027996341915808444, 124179.0, 44.382488861238386, 6.481358800950746, -1.4239824291174026, 0.36033111753727776, 0.9747389554360885, -0.21220380813326614, 0.0555550552275008, 316790.0, 4078.1183765875367, 59.96708636268954, -3.31376828035019, -1.0049046822381449, 0.9908022309988105, -0.06277483614204606, -0.03406570967175063, 33200.746843509725, 81.21943265089648, 85.43846683567924, 81.08924391402017, 0.5494193029955564, 0.6060931043275098, 0.5677589705874355, 348273.0, 4172.812414399049, 29.77384982470648, 34.06060475546482, 31.370284231048633, 0.5347892748162564, 0.626182669173059, 0.5652767493045959, 65428.0, 172723.86430885858, 242.67394693403435, 241.652748058935, 226.7792535305985, 0.5879697747648577, 0.5852496016263616, 0.5431266985588855, 306561.0, 36400.52528208089, 105.20637654496169, 110.4668760866516, 106.47918358825812, 0.557812293412293, 0.5877186068511792, 0.5758360937190969 ],