0

There were questions about this topic from 2012 and 2015, saying that the raw file consisted of 12 bit header and following RGBA info for each pixel.

However, on Android 12, the output of "adb shell screencap -p" has changed and the beginning look like the following:

FF FE FD FF 50 00 4E 00 47 00 0D 00 0A 00 0D 00 ÿþýÿP�N�G�������
0A 00 1A 00 0D 00 0A 00 00 00 00 00 00 00 0D 00 ����������������
0A 00 49 00 48 00 44 00 52 00 00 00 00 00 07 00 ��I�H�D�R�������
FD FF 00 00 00 00 04 00 FD FF 08 00 06 00 00 00 ýÿ������ýÿ������
00 00 00 00 FD FF 24 00 7E 04 00 00 00 00 00 00 ����ýÿ$���������
01 00 73 00 52 00 47 00 42 00 00 00 FD FF FD FF ��s�R�G�B���ýÿýÿ

It starts with 0xFFFE (UTF-16 BOM) and has "PNG" and "sRGB" at the beginning, though it cannot be opened as a PNG file. How to convert this jumble of data to a proper image file?

  • I'm not sure how you're collecting the output from that command, but `adb shell screencap -p /storage/emulated/0/Pictures/test.png` just gave me a valid PNG on 12. – Mike M. Feb 19 '22 at 01:06
  • It's slow. Especially when the device overheats it can take up to 10 seconds for the PNG conversion to finish. Thus I want to move RAW to PNG conversion from Android device to my PC. – user167420 Feb 19 '22 at 10:08
  • You need to edit your question to explain that then, 'cause it doesn't say anything about any of that. As is, it sounds like you're just asking why that PNG is corrupted. It's especially confusing since you're using `-p`, which is explicitly telling `screencap` to save it as a PNG. – Mike M. Feb 19 '22 at 14:28

0 Answers0