import java.util.Scanner; public class RGBA { public static void main(String[] args) { Scanner in = new Scanner(System.in); System.out.print("Enter a 32-bit integer: "); int num = in.nextInt(); int r = (num >> 24) & 0xFF; int g = (num >> 16) & 0xFF; int b = (num >> 8) & 0xFF; int a = num & 0xFF; System.out.println("Red = " + r); System.out.println("Green = " + g); System.out.println("Blue = " + b); System.out.println("Alpha = " + a); } }
16. What do the following two code fragments do given integers a and b? a-a +...
the following python code edits BMP image file to negative but I need help with modifying this code so it turns it the same BMP image file into a black and white instead of a negative. heres python code I have so far [pasted below] ## # This program processes a digital image by creating a negative of a BMP image. # from io import SEEK_CUR from sys import exit def main() : filename = input("Please enter the file name:...
AssignmentBitmap files map three 8-bit (1-byte) color channels per pixel. A pixel is a light-emitting "dot" on your screen. Whenever you buy a new monitor, you will see the pixel configuration by its width and height, such as 1920 x 1080 (1080p) or 3840x2160 (4K). This tells us that we have 1080 rows (height), and each row has 1920 (width) pixels.The bitmap file format is fairly straight forward where we tell the file what our width and height are. When...
could you please help me with this problem, also I need a little text so I can understand how you solved the problem? import java.io.File; import java.util.Scanner; /** * This program lists the files in a directory specified by * the user. The user is asked to type in a directory name. * If the name entered by the user is not a directory, a * message is printed and the program ends. */ public class DirectoryList { public static...