AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Ascii art toy easy2/18/2024 ![]() ![]() ![]() If we take a dark region in the tree, the average is quite low, and it gets an uppercase B, which is one of the characters that uses the most ink. If we take a block in a bright region, the average grayscale is very high, so it ends up getting a single quote, which has very little ink. To see an example, let’s consider taking a block that’s 8 pixels tall and 4 pixels wide in different parts of an image of an Ursinus flag. In particular, we can average all of the grayscale values in a rectangular block that’s twice as tall as it is wide, and print out a single character for this block. To address both of these problems, we can output a single character per block of pixels. ![]() However, not only would this print out way too many characters, but the characters are only printed out half as wide as they are tall, so this would end up printing out an image that’s stretched out by a factor of 2 vertically (the “aspect ratio” would be wrong). Part 2: Rectangular AveragingĪt this point, we could simply print out a row of text for each row in the grayscale image, and print out the character at the index of GRAYSCALE_VALUES with the closest grayscale value. This indicates that a B is a darker character, with a grayscale value of only about 0.08. For instance, let’s run the following code, using the methods provided in the assignment: We usually treat the outer array index as a row (y coordinate) and the inner array index as a column (x coordinate). In this assignment, we will be dealing with grayscale images, in which each pixel goes from black (0) to white (1). Part 1: Grayscale Images and TextĪs we discussed in our 2D arrays module, a 2D array is a natural data structure for image data, since an image is a two dimensional object with both an x and y coordinate for each pixel. Please download the skeleton code for this assignment. In this assignment, we will restrict ourselves to characters in the ASCII subset of UTF-8, including lowercase letters, uppercase letters, and some special characters hence the name “ASCII Art.” An example is given below with the UC logo. Students will write a program to automatically generate “ASCII Art”, which is text that approximates a given image. In this assignment, you will work with with 2D arrays in Java with a concrete, visual application. ![]() Please refer to the following readings and examples offering templates to help get you started: To traverse and manipulate a 2-dimensional array.You can learn more here It was incredibly convenient to have everything organized within the platform, eliminating the need for external communication channels.CS173: Intro to Computer Science - ASCII Art (100 Points) Assignment Goals The website provided a messaging system that enabled me to interact directly with the designers, discuss my requirements, and provide feedback on their proposals. This allowed me to browse through various design styles and find a designer whose work resonated with my vision.Communication with the designers was seamless. The site offered a wide selection of talented designers, each with their own unique portfolio and expertise. The platform provided an intuitive and user-friendly interface, making it easy for me to navigate and find the right web designer for my needs.The process of hiring a web designer was streamlined and efficient. I recently used this website to hire a web designer for my site, and I must say I was highly impressed with the entire experience. ![]()
0 Comments
Read More
Leave a Reply. |