I currently have a set of plist files. Inside are png images, some files have numerous images. I'm using win64 vista.
I've looked for things specifically for this such as FileJuicer, but that is only for mac users.
I have written this script to unpack png files in the plist file packed by TexturePacker
First, make sure you have both the png and plist files in the same directory, in my case: freeGifts.plist and freeGifts.png
Second, same the following script as unpack_plist.py
Then, python unpack_plist.py freeGifts, it will generate lots of png files to a directory named freeGifts
Requirement: python, PIL
#! /usr/lical/bin/python
import os,Image,sys
from xml.etree import ElementTree
def tree_to_dict(tree):
d = {}
for index, item in enumerate(tree):
if item.tag == 'key':
if tree[index+1].tag == 'string':
d[item.text] = tree[index + 1].text
elif tree[index + 1].tag == 'true':
d[item.text] = True
elif tree[index + 1].tag == 'false':
d[item.text] = False
elif tree[index+1].tag == 'dict':
d[item.text] = tree_to_dict(tree[index+1])
return d
def gen_png_from_plist(plist_filename, png_filename):
file_path = plist_filename.replace('.plist', '')
big_image = Image.open(png_filename)
root = ElementTree.fromstring(open(plist_filename, 'r').read())
plist_dict = tree_to_dict(root[0])
to_list = lambda x: x.replace('{','').replace('}','').split(',')
for k,v in plist_dict['frames'].items():
rectlist = to_list(v['frame'])
width = int( rectlist[3] if v['rotated'] else rectlist[2] )
height = int( rectlist[2] if v['rotated'] else rectlist[3] )
box=(
int(rectlist[0]),
int(rectlist[1]),
int(rectlist[0]) + width,
int(rectlist[1]) + height,
)
sizelist = [ int(x) for x in to_list(v['sourceSize'])]
rect_on_big = big_image.crop(box)
result_image = Image.new('RGBA', sizelist, (0,0,0,0))
result_box=(
( sizelist[0] - width )/2,
( sizelist[1] - height )/2,
( sizelist[0] + width )/2,
( sizelist[1] + height )/2
)
result_image.paste(rect_on_big, result_box, mask=0)
if v['rotated']:
result_image = result_image.rotate(90)
if not os.path.isdir(file_path):
os.mkdir(file_path)
outfile = (file_path+'/' + k).replace('gift_', '')
print outfile, "generated"
result_image.save(outfile)
if __name__ == '__main__':
filename = sys.argv[1]
plist_filename = filename + '.plist'
png_filename = filename + '.png'
if (os.path.exists(plist_filename) and os.path.exists(png_filename)):
gen_png_from_plist( plist_filename, png_filename )
else:
print "make sure you have boith plist and png files in the same directory"
Lol, this is all Steve Jobs' doing. You could parse the plist in C# using ChadBurggraf's library https://github.com/ChadBurggraf/plists-cs. But as discussed in the comments, the files you want probably aren't in the plist file.
Thanks to Sean.Z. first.
But I found that the rotate is not good, and ygweric's patch is not good enough.
because it will fail when the png include jpg file(mode P). and sometime Transparent will became black background.
I try to fix this and my code as below:
#! /usr/lical/bin/python
import os,Image,sys
from xml.etree import ElementTree
def tree_to_dict(tree):
d = {}
for index, item in enumerate(tree):
if item.tag == 'key':
if tree[index+1].tag == 'string':
d[item.text] = tree[index + 1].text
elif tree[index + 1].tag == 'true':
d[item.text] = True
elif tree[index + 1].tag == 'false':
d[item.text] = False
elif tree[index+1].tag == 'dict':
d[item.text] = tree_to_dict(tree[index+1])
return d
def gen_png_from_plist(plist_filename, png_filename):
file_path = plist_filename.replace('.plist', '')
big_image = Image.open(png_filename)
root = ElementTree.fromstring(open(plist_filename, 'r').read())
plist_dict = tree_to_dict(root[0])
to_list = lambda x: x.replace('{','').replace('}','').split(',')
for k,v in plist_dict['frames'].items():
rectlist = to_list(v['frame'])
width = int( rectlist[3] if v['rotated'] else rectlist[2] )
height = int( rectlist[2] if v['rotated'] else rectlist[3] )
box=(
int(rectlist[0]),
int(rectlist[1]),
int(rectlist[0]) + width,
int(rectlist[1]) + height,
)
sizelist = [ int(x) for x in to_list(v['sourceSize'])]
rect_on_big = big_image.crop(box)
if v['rotated']:
rect_on_big = rect_on_big.rotate(90)
result_image = Image.new('RGBA', sizelist, (0,0,0,0))
if v['rotated']:
result_box=(
( sizelist[0] - height )/2,
( sizelist[1] - width )/2,
( sizelist[0] + height )/2,
( sizelist[1] + width )/2
)
else:
result_box=(
( sizelist[0] - width )/2,
( sizelist[1] - height )/2,
( sizelist[0] + width )/2,
( sizelist[1] + height )/2
)
result_image.paste(rect_on_big, result_box, mask=0)
if not os.path.isdir(file_path):
os.mkdir(file_path)
outfile = (file_path+'/' + k).replace('gift_', '')
print outfile, "generated"
result_image.save(outfile)
if __name__ == '__main__':
filename = sys.argv[1]
plist_filename = filename + '.plist'
png_filename = filename + '.png'
if (os.path.exists(plist_filename) and os.path.exists(png_filename)):
gen_png_from_plist( plist_filename, png_filename )
else:
print "make sure you have boith plist and png files in the same directory"
Thanks to Sean.Z.
for the unpack_plist.py, you need:
1: PIL have been installed on you pc.
2: use python 2.5
python2.5 unpack_plist.py birdfly
or you will fail.
-----2013-07-25--
for some plist which is rotated, the above spcript may have some bugs. i modify it like following:
#python2.5 unpack_plist.py birdfly
#! /usr/lical/bin/python
import os,Image,sys
from xml.etree import ElementTree
def tree_to_dict(tree):
d = {}
for index, item in enumerate(tree):
if item.tag == 'key':
if tree[index+1].tag == 'string':
d[item.text] = tree[index + 1].text
elif tree[index + 1].tag == 'true':
d[item.text] = True
elif tree[index + 1].tag == 'false':
d[item.text] = False
elif tree[index+1].tag == 'dict':
d[item.text] = tree_to_dict(tree[index+1])
return d
def gen_png_from_plist(plist_filename, png_filename):
file_path = plist_filename.replace('.plist', '')
big_image = Image.open(png_filename)
root = ElementTree.fromstring(open(plist_filename, 'r').read())
plist_dict = tree_to_dict(root[0])
to_list = lambda x: x.replace('{','').replace('}','').split(',')
for k,v in plist_dict['frames'].items():
print "-----start\n----------"
rectlist = to_list(v['frame'])
print rectlist, "--------rectlist"
width = int( rectlist[3] if v['rotated'] else rectlist[2] )
height = int( rectlist[2] if v['rotated'] else rectlist[3] )
print width,height,"----width,height"
box=(
int(rectlist[0]),
int(rectlist[1]),
int(rectlist[0]) + width,
int(rectlist[1]) + height,
)
# bos is start & end point
print box,"-----_box-"
print v['rotated'], "---rotated"
sizelist = [ int(x) for x in to_list(v['sourceSize'])]
rect_on_big = big_image.crop(box)
'''
result_image = Image.new('RGBA', sizelist, (0,0,0,0))
result_box=(
( sizelist[0] - width )/2,
( sizelist[1] - height )/2,
( sizelist[0] + width )/2,
( sizelist[1] + height )/2
)
result_image.paste(rect_on_big, result_box, mask=0)
if v['rotated']:
result_image = result_image.rotate(90)
if not os.path.isdir(file_path):
os.mkdir(file_path)
outfile = (file_path+'/' + k).replace('gift_', '')
print result_box,"-----result_box-"
print outfile, "generated"
# result_image.save(outfile)
'''
if v['rotated']:
rect_on_big = rect_on_big.rotate(90)
if not os.path.isdir(file_path):
os.mkdir(file_path)
outfile = (file_path+'/' + k).replace('gift_', '')
rect_on_big.save(outfile);
if __name__ == '__main__':
filename = sys.argv[1]
plist_filename = filename + '.plist'
png_filename = filename + '.png'
if (os.path.exists(plist_filename) and os.path.exists(png_filename)):
gen_png_from_plist( plist_filename, png_filename )
else:
print "make sure you have boith plist and png files in the same directory"
If you have JRE in your PC or you may be install then you can use a tool which i create to unpack .plist file. It also has support .pack file that use in LibGdx projects and .xml file used in many engine like unity to pack texture.
https://github.com/itsabhiaryan/TextureUnPacker
Related
This question already has answers here:
How do you hide arbitrary section of code in VS Code?
(5 answers)
Closed 2 years ago.
is there a way to select parts of my code to hide? I mean like this, I'm trying to code a game with python using vscode, and i would like to hide some parts of it
import pygame, random, os
from pygame.locals import *
pygame.init()
screen = pygame.display.set_mode((1020, 585))
pygame.display.set_caption('2snakes!')
#files location
current_path = os.path.dirname(__file__)
data_path = os.path.join(current_path, 'data')
icon = pygame.image.load(os.path.join(data_path, 'icon.png'))
pygame.display.set_icon(icon)
#variables
direction = 'RIGHT'
direction2 = 'RIGHT'
change_to = direction
change2_to = direction2
fps = 12
#snake
size = 15
s_pos = 60
snake = [(s_pos + size * 2, s_pos),(s_pos + size, s_pos),(s_pos, s_pos)]
s_skin = pygame.Surface((size, size))
s_skin.fill((82,128,208))
#snake2
size2 = 15
s2_pos = 195
snake2 = [(s2_pos + size2 * 2, s2_pos),(s2_pos + size2, s2_pos),(s2_pos, s2_pos)]
s2_skin = pygame.Surface((size2, size2))
s2_skin.fill((208,128,82))
#apple
apple = pygame.Surface((size, size))
apple_pos = ((random.randint(0, 68) * 15, (random.randint(0, 39)) * 15))
#collission
def collision(c1,c2):
return (c1[0] == c2[0]) and (c1[1] == c2[1])
#game over
def gameOverBlue():
#pygame.quit()
print("gameoverblue")
def gameOverRed():
print("gameoverred")
#update
while True:
#fps
pygame.time.Clock().tick(fps)
#quit game
for event in pygame.event.get():
if event.type == QUIT:
pygame.quit()
#input
elif event.type == pygame.KEYDOWN:
#snake
if event.key == ord('w'):
change_to = 'UP'
if event.key == ord('s'):
change_to = 'DOWN'
if event.key == ord('a'):
change_to = 'LEFT'
if event.key == ord('d'):
change_to = 'RIGHT'
#snake2
if event.key == pygame.K_UP:
change2_to = 'UP'
if event.key == pygame.K_DOWN:
change2_to = 'DOWN'
if event.key == pygame.K_LEFT:
change2_to = 'LEFT'
if event.key == pygame.K_RIGHT:
change2_to = 'RIGHT'
#quit game
if event.key == pygame.K_ESCAPE:
pygame.event.post(pygame.event.Event(pygame.QUIT))
#smooth snake movement
#snake
if change_to == 'UP' and direction != 'DOWN':
direction = 'UP'
if change_to == 'DOWN' and direction != 'UP':
direction = 'DOWN'
if change_to == 'LEFT' and direction != 'RIGHT':
direction = 'LEFT'
if change_to == 'RIGHT' and direction != 'LEFT':
direction = 'RIGHT'
#snake2
if change2_to == 'UP' and direction2 != 'DOWN':
direction2 = 'UP'
if change2_to == 'DOWN' and direction2 != 'UP':
direction2 = 'DOWN'
if change2_to == 'LEFT' and direction2 != 'RIGHT':
direction2 = 'LEFT'
if change2_to == 'RIGHT' and direction2 != 'LEFT':
direction2 = 'RIGHT'
#movement
#snake
new_pos = None
if direction == 'DOWN':
new_pos = (snake[0][0], snake[0][1] + size)
if direction == 'UP':
new_pos = (snake[0][0], snake[0][1] - size)
if direction == 'LEFT':
new_pos = (snake[0][0] - size, snake[0][1])
if direction == 'RIGHT':
new_pos = (snake[0][0] + size, snake[0][1])
if new_pos:
snake = [new_pos] + snake
del snake[-1]
new_pos2 = None
if direction2 == 'DOWN':
new_pos2 = (snake2[0][0], snake2[0][1] + size2)
if direction2 == 'UP':
new_pos2 = (snake2[0][0], snake2[0][1] - size2)
if direction2 == 'LEFT':
new_pos2 = (snake2[0][0] - size2, snake2[0][1])
if direction2 == 'RIGHT':
new_pos2 = (snake2[0][0] + size2, snake2[0][1])
if new_pos2:
snake2 = [new_pos2] + snake2
del snake2[-1]
#snake apple collision
if collision(snake[0], apple_pos):
snake.append((-20,-20))
apple_pos = ((random.randint(0, 68) * 15, (random.randint(0, 39)) * 15))
#snake2 apple collision
if collision(snake2[0], apple_pos):
snake2.append((-20,-20))
apple_pos = ((random.randint(0, 68) * 15, (random.randint(0, 39)) * 15))
#snake wall collisison
if snake[0][0] < 0 or snake[0][1] < 0:
gameOver()
elif snake[0][0] > 1020 or snake[0][1] > 585:
gameOver()
#snake2 wall collisison
if snake2[0][0] < 0 or snake2[0][1] < 0:
gameOverRed()
elif snake2[0][0] > 1020 or snake2[0][1] > 585:
gameOverRed()
#self collisison
if snake[0] in snake[1:]:
print("self collision")
print(snake2[0], "is in", snake2[2:])
if snake2[0] in snake2[1:]:
print("self collision")
print(snake2[0], "is in", snake2[2:])
#rendering
apple.fill((255,0,0))
screen.fill((0,0,0))
screen.blit(apple,apple_pos)
for pos in snake:
screen.blit(s_skin,pos)
for pos2 in snake2:
screen.blit(s2_skin,pos2)
pygame.display.update()
this is my code and the code in #smooth snake movement is the part i want to hide, is a big chunk of code that just confuse me when i am looking for some bug or thing in the code
def collision(c1,c2):
return (c1[0] == c2[0]) and (c1[1] == c2[1])
i would like to just hide it like i can do with a def in vscode for example, is there a way to do it?
yes, when you have code under a tab:
code
more code
even more code
you can click near the "code" on the left and it will automatically shrink all the code inside (in this case the "more code" and the "even more code".
you can also try to find a code shrinker on the "extensions" button on the left of vscode.
import json
i = 1
file_name = 'PolitiFact_Fake_' + str(i) + '-Webpage.json'
with open(file_name, 'r') as fp:
obj = json.load(fp)
text = obj['text']
length = len(text)
wordlist = text.split()
wordfreq = []
for w in wordlist:
wordfreq.append(wordlist.count(w))
lengthslova = len(wordlist)
wordfind = 'in'
indexword = wordlist.index(wordfind)
indexfreq = wordfreq[indexword]
findword = [wordfreq, wordlist]
findwordt = [[row[j] for row in findword] for j in range(lengthslova)]
wordfind = "attacks"
indexfreq = 0
if indexword != ValueError:
indexword = wordlist.index(wordfind)
indexfreq = wordfreq[indexword]
findword = [wordfind, indexfreq]
indexfreq = wordfreq[indexword]
findword = [wordfind, indexfreq]
print('The freq of word ' + str(wordfind) + ':', indexfreq)
else:
indexfreq = 0
findword = [wordfind, indexfreq]
print('The freq of word ' + str(wordfind) + ':', indexfreq)
I keep receiving this error:
ValueError: 'attacks' is not in list
I m using CURL to retreive a JSON string from Wikipedia, eg
https://en.wikipedia.org/w/api.php?action=opensearch&limit=1&format=json&search=syntax
I don't use a JSON parser, and I am searching a way to remove the unicode part, which is useless for me.
I have already tried &utf8= in url, and WideCharToMultiByte and wcstombs.
I just want to convert this string to ANSI format, to be used in another application, even if I will lose data.
Here is the code I am using to convert the string:
void UnicodeToAnsi(char *str, char *str2)
{
unsigned char ch;
char *pr = str;
char *pw = str2;
while ( (*pr) != 0 )
{
ch = (*pr);
if ( ch == '\\' )
{
if ( *(pr+1) == 'u')
{
char szANSIString [2] = {'\0'};
wchar_t wcsString[2] = {0,'\0'};
char h[5]={'\0'};
int v;
strncpy(h,pr + 2,4);
v = (int)strtol(h, NULL, 16);
#if 0
wcsString[0] = v;
#ifndef _WIN32
WideCharToMultiByte ( CP_ACP, // ANSI code page
WC_COMPOSITECHECK, // Check for accented characters
wcsString, // Source Unicode string
-1, // -1 means string is zero-terminated
szANSIString, // Destination char string
sizeof(szANSIString), // Size of buffer
NULL, // No default character
NULL ); // Don't care about this flag
#else
wcstombs(szANSIString, wcsString, sizeof(szANSIString));
#endif
ch = *szANSIString;
if (ch == '\0') ch = '?';
#endif
//bored with this unicode, easy way
ch = '-';
if (v == 232) ch = 138;
if (v == 233) ch = 130;
if (v == 234) ch = 136;
if (v == 224) ch = 133;
if (v == 225) ch = 'a';
if (v == 226) ch = 'a';
if (v == 257) ch = 'a';
if (v == 231) ch = 135;
pr = pr + 5;
}
}
(*pw) = ch;
++pw;
++pr;
}
*pw = '\0';
return;
}
I'm trying to figure out if there is an easy way to convert numbers into words take 9 and convert it to nine.
There is an excellent library for .NET called Humanizer that can do exactly this. I haven't tried this yet, but it looks like there is a PowerShell wrapper for it. I suspect this will do exactly what you need.
This has been asked about .NET/C#; you could put this in a class and use Add-Type in powershell to make this work.
.NET convert number to string representation (1 to one, 2 to two, etc...)
Maybe something like this (untested):
$class = #"
public class Num2Word
{
public static string NumberToText( int n)
{
if ( n < 0 )
return "Minus " + NumberToText(-n);
else if ( n == 0 )
return "";
else if ( n <= 19 )
return new string[] {"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight",
"Nine", "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen",
"Seventeen", "Eighteen", "Nineteen"}[n-1] + " ";
else if ( n <= 99 )
return new string[] {"Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy",
"Eighty", "Ninety"}[n / 10 - 2] + " " + NumberToText(n % 10);
else if ( n <= 199 )
return "One Hundred " + NumberToText(n % 100);
else if ( n <= 999 )
return NumberToText(n / 100) + "Hundreds " + NumberToText(n % 100);
else if ( n <= 1999 )
return "One Thousand " + NumberToText(n % 1000);
else if ( n <= 999999 )
return NumberToText(n / 1000) + "Thousands " + NumberToText(n % 1000);
else if ( n <= 1999999 )
return "One Million " + NumberToText(n % 1000000);
else if ( n <= 999999999)
return NumberToText(n / 1000000) + "Millions " + NumberToText(n % 1000000);
else if ( n <= 1999999999 )
return "One Billion " + NumberToText(n % 1000000000);
else
return NumberToText(n / 1000000000) + "Billions " + NumberToText(n % 1000000000);
}
}
#"
Add-Type -TypeDefinition $class
[Num2Word]::NumberToText(555)
There's no reason you couldn't write this as pure powershell, but this was already written!
I am trying to access pixel data from a CGImage. I want to be able to access the RGB values as integers. I think I am nearly there with this code:
UIImage* theImage = [UIImage imageNamed:#"rgb.png"];
CGImageRef cgImageRef = CGImageRetain(theImage.CGImage);
CFDataRef* imageData = CGDataProviderCopyData(CGImageGetDataProvider(cgImageRef));
NSLog(#"the data = %#", imageData);
This then logs:
the data = <010002fe fffdff02 0200fe04 0003fc>
The image is a 5x1 png containing a black, white, red, green and blue pixel in that order.
I don't really understand what I am looking at here. How can I get an array of RGB values, or something similar so I can work with them.
Thanks,
Rich
Here's some sample code that will print a bunch of relevant info about an image, as well as a dump of the image's pixel data. It will work on images with alpha channels, as well as images without. The code will even work on images that are not in the RGB color space, though I doubt you'd be likely to get any of those on iOS.
Copy-paste it into your project and try to run it against a few of your image files, and then perhaps you can adapt it to your needs
-(void)imageDump:(NSString*)file
{
UIImage* image = [UIImage imageNamed:file];
CGImageRef cgimage = image.CGImage;
size_t width = CGImageGetWidth(cgimage);
size_t height = CGImageGetHeight(cgimage);
size_t bpr = CGImageGetBytesPerRow(cgimage);
size_t bpp = CGImageGetBitsPerPixel(cgimage);
size_t bpc = CGImageGetBitsPerComponent(cgimage);
size_t bytes_per_pixel = bpp / bpc;
CGBitmapInfo info = CGImageGetBitmapInfo(cgimage);
NSLog(
#"\n"
"===== %# =====\n"
"CGImageGetHeight: %d\n"
"CGImageGetWidth: %d\n"
"CGImageGetColorSpace: %#\n"
"CGImageGetBitsPerPixel: %d\n"
"CGImageGetBitsPerComponent: %d\n"
"CGImageGetBytesPerRow: %d\n"
"CGImageGetBitmapInfo: 0x%.8X\n"
" kCGBitmapAlphaInfoMask = %s\n"
" kCGBitmapFloatComponents = %s\n"
" kCGBitmapByteOrderMask = 0x%.8X\n"
" kCGBitmapByteOrderDefault = %s\n"
" kCGBitmapByteOrder16Little = %s\n"
" kCGBitmapByteOrder32Little = %s\n"
" kCGBitmapByteOrder16Big = %s\n"
" kCGBitmapByteOrder32Big = %s\n",
file,
(int)width,
(int)height,
CGImageGetColorSpace(cgimage),
(int)bpp,
(int)bpc,
(int)bpr,
(unsigned)info,
(info & kCGBitmapAlphaInfoMask) ? "YES" : "NO",
(info & kCGBitmapFloatComponents) ? "YES" : "NO",
(info & kCGBitmapByteOrderMask),
((info & kCGBitmapByteOrderMask) == kCGBitmapByteOrderDefault) ? "YES" : "NO",
((info & kCGBitmapByteOrderMask) == kCGBitmapByteOrder16Little) ? "YES" : "NO",
((info & kCGBitmapByteOrderMask) == kCGBitmapByteOrder32Little) ? "YES" : "NO",
((info & kCGBitmapByteOrderMask) == kCGBitmapByteOrder16Big) ? "YES" : "NO",
((info & kCGBitmapByteOrderMask) == kCGBitmapByteOrder32Big) ? "YES" : "NO"
);
CGDataProviderRef provider = CGImageGetDataProvider(cgimage);
NSData* data = (id)CGDataProviderCopyData(provider);
[data autorelease];
const uint8_t* bytes = [data bytes];
printf("Pixel Data:\n");
for(size_t row = 0; row < height; row++)
{
for(size_t col = 0; col < width; col++)
{
const uint8_t* pixel =
&bytes[row * bpr + col * bytes_per_pixel];
printf("(");
for(size_t x = 0; x < bytes_per_pixel; x++)
{
printf("%.2X", pixel[x]);
if( x < bytes_per_pixel - 1 )
printf(",");
}
printf(")");
if( col < width - 1 )
printf(", ");
}
printf("\n");
}
}
Here's some sample output on two images I tried. They're both 5x3 rgb. The "a.png" image has an alpha channel, while the "b.rgb" does not.
===== a.png =====
CGImageGetHeight: 5
CGImageGetWidth: 3
CGImageGetColorSpace: <CGColorSpace 0x4d08ff0> (kCGColorSpaceDeviceRGB)
CGImageGetBitsPerPixel: 32
CGImageGetBitsPerComponent: 8
CGImageGetBytesPerRow: 20
CGImageGetBitmapInfo: 0x00000003
kCGBitmapAlphaInfoMask = YES
kCGBitmapFloatComponents = NO
kCGBitmapByteOrderMask = NO
kCGBitmapByteOrderDefault = NO
kCGBitmapByteOrder16Little = NO
kCGBitmapByteOrder32Little = NO
kCGBitmapByteOrder16Big = NO
kCGBitmapByteOrder32Big = NO
Pixel Data:
(00,00,00,FF), (FF,FF,FF,FF), (FF,00,00,FF), (00,FF,00,FF), (00,00,FF,FF)
(00,00,00,FF), (FF,FF,FF,FF), (FF,00,00,FF), (00,FF,00,FF), (00,00,FF,FF)
(FF,FF,FF,00), (FF,FF,FF,00), (FF,FF,FF,00), (FF,FF,FF,00), (FF,FF,FF,00)
===== b.png =====
CGImageGetHeight: 5
CGImageGetWidth: 3
CGImageGetColorSpace: <CGColorSpace 0x4d08ff0> (kCGColorSpaceDeviceRGB)
CGImageGetBitsPerPixel: 24
CGImageGetBitsPerComponent: 8
CGImageGetBytesPerRow: 15
CGImageGetBitmapInfo: 0x00000000
kCGBitmapAlphaInfoMask = NO
kCGBitmapFloatComponents = NO
kCGBitmapByteOrderMask = NO
kCGBitmapByteOrderDefault = NO
kCGBitmapByteOrder16Little = NO
kCGBitmapByteOrder32Little = NO
kCGBitmapByteOrder16Big = NO
kCGBitmapByteOrder32Big = NO
Pixel Data:
(00,00,00), (FF,FF,FF), (FF,00,00), (00,FF,00), (00,00,FF)
(00,00,00), (FF,FF,FF), (FF,00,00), (00,FF,00), (00,00,FF)
(00,00,00), (FF,FF,FF), (FF,00,00), (00,FF,00), (00,00,FF)