Fundamentals of Computer Science LCSCI4208

You will write a program in Java that reduces the size of an image horizontally by removing columns of pixels.
iuww520iuww520iuww520iuww520iuww520iuww520iuww520iuww520
First the image will be read into the program using the method fromFileImage. You can query the image to get the Color of a given pixel using the getColorAt(int x, int y) method. Each pixel should be represented by a class Pixel containing all salient information about each pixel in the image.
Given any image, your program will allow the user to indicate whether to remove the bluest column, “b”, or a random column, “r”. The bluest column will use the metric of the sum of the blue value of the RGB value stored as a pixel’s colour. The column to be removed will be highlighted by the program. If removing the bluest, the chosen column will be shown as blue on the image. If the column is selected at random, it should be highlighted in red. The user will then confirm that the column should be removed by typing “d”.
This program can be broken down into smaller tasks: (i) representing the image file with a data structure of your choosing; (ii) finding the bluest column; (iii) removing a column; and (iv) user interaction in the world program.
The program should allow the following key events:
“b” to remove the bluest column
“r” to remove a randomly selected column
“d” confirms the removal and shows the image without that column
“u” undo the most recent deletion
This program also requires you to construct new images, one pixel at a time.
Your design might consider the use of a ComputedPixelImage object. You might
consider methods such as setPixel(int x, int y, Color c) that allows you to set an individual pixel, and setPixels(int x, int y, int width, int height, Color c) that allows you to fill an entire rectangle’s worth of pixels with a single colour.
Finally, as you construct various examples of images, you may want to save them as files. For this you can use the method saveImage(String filename), which will save the current image as a PNG file. You may want to use this to make test cases for yourself.
In summary, this project asks:
1. Represent the PNG image using a data structure of your choosing
2. Compressing horizontally by removing columns of pixels
3. Columns at random: highlight in red
4. Columns with the highest sum of Blue in the colour: highlight in blue
5. Create a user interface that allows the user to select how deletion should
happen (random or bluest). The program then highlights the column and 
removes it upon user confirmation. The interface allows the user to undo any
number of deletions.

相关推荐

  1. Fundamentals of Computer Science LCSCI4208

    2024-07-18 17:24:02       20 阅读
  2. 408真题笔记

    2024-07-18 17:24:02       37 阅读
  3. 408经验贴

    2024-07-18 17:24:02       26 阅读
  4. D.408之计算机网络

    2024-07-18 17:24:02       54 阅读
  5. leetcode - 408. Valid Word Abbreviation

    2024-07-18 17:24:02       39 阅读
  6. 408数据结构专项2011

    2024-07-18 17:24:02       28 阅读
  7. c yuv422转yuv420p

    2024-07-18 17:24:02       49 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-18 17:24:02       66 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-18 17:24:02       70 阅读
  3. 在Django里面运行非项目文件

    2024-07-18 17:24:02       57 阅读
  4. Python语言-面向对象

    2024-07-18 17:24:02       68 阅读

热门阅读

  1. 河南萌新联赛2024第(一)场:河南农业大学

    2024-07-18 17:24:02       27 阅读
  2. Unity:UI进入离开事件

    2024-07-18 17:24:02       19 阅读
  3. opencv—常用函数学习_“干货“_6

    2024-07-18 17:24:02       18 阅读
  4. web前端 Vue 框架面试120题(四)

    2024-07-18 17:24:02       18 阅读
  5. 富格林:可信办法阻挠虚假受骗

    2024-07-18 17:24:02       19 阅读
  6. ClickHouse中使用UNION

    2024-07-18 17:24:02       20 阅读
  7. vue3项目中pinia的用法详解(值得收藏)

    2024-07-18 17:24:02       20 阅读
  8. jd-gui反编译出现中文乱码问题

    2024-07-18 17:24:02       18 阅读
  9. CL11命令行解析使用实例

    2024-07-18 17:24:02       19 阅读
  10. PCB的层叠结构

    2024-07-18 17:24:02       18 阅读
  11. vim+cscope+ctags

    2024-07-18 17:24:02       23 阅读
  12. gitlab reset passwd

    2024-07-18 17:24:02       20 阅读
  13. 02-Redis未授权访问漏洞

    2024-07-18 17:24:02       21 阅读