They have lots of info on me, I have a facebook account and have done so for years, it was the thing to have then. My phone number is not on it. I don't have the Facebook app on my phone these days, just the messenger part, and only for a couple of people to contact me, most will text me via SMS or phone.
I agree, Meta, like others, even without an account will know something about me. Just have to try and keep some things private
Also, never saw the need for Whatsapp, people used to ask for me to join it, but as I said to them, I have SMS and a phone, use that, or email
Thanks for taking the time to write such a detailed explanation.
I hadn't considered running fiber for future expansion, so that's something I'll definitely read more about.
Question
DWk
Ok, so I'm trying to convert an 24-bit colored bitmap to an 8-bit (256 colors) grayscale bitmap.
I am able to convert the bitmap to a 24-bit greyscale (sort of, if you understand what I'm talking about), by using this:
FileInputStream file = new FileInputStream(new File(archivo)); FileOutputStream gray = new FileOutputStream(new File("gray.bmp")); byte[] header = new byte[54]; byte[] data = new byte[921600]; file.read(header); file.read(data); byte[] redmatrix = new byte[921600]; byte[] greenmatrix = new byte[921600]; byte[] bluematrix = new byte[921600]; byte[] mix = new byte[921600]; int n; for (n=2; n+3 < 921600; n=n+3){ redmatrix[n] = (byte)(Math.round(((int)data[n-2] + (int)data[n-1] + (int)data[n])/3)); } for (n=1; n+3 < 921600; n=n+3){ greenmatrix[n] = (byte)(Math.round(((int)data[n-1]+(int)data[n]+(int)data[n+1])/3)); } for (n=0; n+3 < 921600; n=n+3){ bluematrix[n] = (byte)(Math.round(((int)data[n]+(int)data[n+1]+(int)data[n+2])/3)); } for (n=2; n+3 < 921600; n=n+3){ mix[n] = redmatrix[n]; } for (n=1; n+3 < 921600; n=n+3){ mix[n] = greenmatrix[n]; } for (n=0; n+3 < 921600; n=n+3){ mix[n] = bluematrix[n]; } gray.write(header); gray.write(mix); gray.close(); } catch (Exception e){ System.out.println(e);I do get a greyscale image, but not the right one.
Link to comment
https://www.neowin.net/forum/topic/369150-how-to-convert-a-24-bit-rgb-bmp-to-8-bit-grayscale/Share on other sites
3 answers to this question
Recommended Posts