Bitmap and vector graphics
แนะนำใหม่
21:52
ระบบตัวเลข & ข้อมูล
รูปนี้ เพลงนี้ วิดีโอนี้ ชื่อของคุณ ข้อความ ไฟล์ทุกไฟล์บนทุกอุปกรณ์ — ภายในคอมพิวเตอร์ ทั้งหมดนั้นคือเพียงเลขศูนย์และเลขหนึ่ง.…
บรรยายภาษาอังกฤษ · สลับคำบรรยายภาษาอังกฤษและภาษาจีนได้
ในบทเรียนนี้
| English | ความหมาย |
|---|---|
| bitmap/ˈbɪtmæp/ | บิตแมป |
| vector/ˈvektə/ | เวกเตอร์ |
| pixel/ˈpɪksl/ | พิกเซล |
| file header/faɪl ˈhedə/ | ส่วนหัวของไฟล์ |
| metadata/ˌmetəˈdeɪtə/ | Information about a file that helps software read and use it. |
| Colour depth/ˈkʌlə depθ/ | The number of bits used to store the colour of one pixel. |
| Image resolution/ˈɪmɪdʒ ˌrezəˈluːʃn/ | The image's own size in pixels, width by height. |
| Screen resolution/skriːn ˌrezəˈluːʃn/ | The number of pixels a screen can display, given as width by height. |
| bits/bɪts/ | A binary digit, taking the value zero or one. |
| true colour | Colour stored using 24 bits per pixel, allowing about 16.7 million colours. |
| bytes | Units of eight bits used to store data in a computer. |
| decimal prefixes | Prefixes used to name data sizes based on powers of 1000. |
| frame/freɪm/ | เฟรม |
| frame rate/freɪm reɪt/ | อัตราเฟรม |
| banding | Visible steps between shades where colours should change smoothly. |
| gradient/ˈɡreɪdɪənt/ | A gradual change from one colour or shade to another. |
| drawing list/ˈdrɔːɪŋ lɪst/ | รายการวาดภาพ |
| drawing objects/ˈdrɔːɪŋ ˈɒbdʒekts/ | วัตถุที่วาด |
| primitives/ˈprɪmɪtɪvz/ | รูปทรงพื้นฐาน |
| properties/ˈprɒpətiz/ | คุณสมบัติ |
| coordinates/kəʊˈɔːdɪnəts/ | Ordered values specifying the position of a point relative to a chosen system. |
| render/ˈrendə/ | การเรนเดอร์ |
ทำไมโลโก้บนป้ายโฆษณาจึงไม่ใช่ภาพถ่าย
- โลโก้บริษัทปรากฏบนบัตรธุรกิจกว้างสองเซนติเมตรและบนป้ายโฆษณาทางหลวงกว้างหกเมตร เป็นไฟล์เดียวกันและคมชัดทั้งสองด้าน
- Enlarge a photograph the same way and it turns to blocks. Nothing is wrong with the photograph; the two files answer different questions.
- ภาพถ่ายจัดเก็บ สีของแต่ละจุด โลโก้จัดเก็บ รูปร่างที่จะวาด การขยายภาพแรกจะกระจายจำนวนพิกเซลคงที่ การขยายภาพที่สองจะวาดรูปร่างใหม่ตามขนาดนั้น
- บทเรียนนี้เกี่ยวกับภาพ bitmap และ vector การคำนวณขนาดไฟล์ที่ข้อสอบถาม และวิธีการให้เหตุผลเลือกคำตอบ

การเข้ารหัส bitmap
- bitmap (ภาพ/bitmapped image) จัดเก็บสีของทุก pixel ในตาราง จากบนลงล่าง
- ที่ต้นไฟล์ file header บันทึก metadata ที่ซอฟต์แวร์ต้องการอ่านพิกเซลที่ตามมา: ความกว้าง ความสูง และความลึกของสี
- Image resolution คือขนาดภาพเองเป็นพิกเซล ความกว้างคูณความสูง Screen resolution คือสิ่งที่จอแสดงผลแสดงได้ ภาพที่ใหญ่กว่าจอจะถูกย่อให้พอดี ภาพความละเอียดต่ำที่ขยายบนจอความละเอียดสูงจะดูเป็นบล็อกๆ
- Colour depth (bit depth) คือจำนวนบิตที่ใช้จัดเก็บสีหนึ่งพิกเซล: 1 บิตให้ขาวดำ, 8 บิตให้ 256 สี, 24 บิตให้ 16.7 ล้านสี ซึ่งเรียกว่า true colour

พิกเซลน้อยลง บล็อกใหญ่ขึ้น

ห้องปฏิบัติการแนวคิดการคำนวณ
Classify concrete examples by the computing idea they demonstrate.
The colour depth (bit depth) of a bitmap image is:
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Colour depth is bits per pixel — more bits means more possible colours (8 bits → 256, 24 bits → 16.7 million).
How many bits of colour depth are needed to store 256 different colours?
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
$2^8 = 256$, so 8 bits per pixel give 256 colours.
What does the file header of a bitmap image store?
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
The header is metadata: without the width and colour depth the pixel bytes cannot be split into rows and pixels. A drawing list belongs to a vector file.
ขนาดไฟล์ bitmap
- หารด้วย 8 เพื่อแปลงเป็น bytes แล้วหารด้วย 1000 หรือ 1024 ขึ้นอยู่กับว่าใช้ family Prefix ใด และ ระบุให้ชัดเจน เพิ่มค่า file header ถ้าโจทย์กำหนดขนาดไว้
- A $3000 \times 2000$ image at 24 bits per pixel is $1.44 \times 10^8$ bits, which is 18.0 MB using decimal prefixes or 17.2 MiB using binary ones. Both are accepted when the working shows which.
A $100 \times 100$ pixel image has a colour depth of 24 bits. What is the size of its uncompressed pixel data in bits, excluding the header?
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
size $=$ ความกว้าง $\times$ ส่วนสูง $\times$ มิติลึก $= 100 \times 100 \times 24 = 240\,000$ bits.
ตัวอย่างวิธีทำ: คำนวณขนาดภาพถ่าย แล้วคำนวณวิดีโอ
- ภาพถ่ายมีขนาด $4000 \times 3000$ พิกเซล ด้วยความลึกสี 24 บิต จงหาขนาดไฟล์เป็น MiB.
- $4000 \times 3000 \times 24 = 2.88 \times 10^8$ บิต. หารด้วย 8: ได้ $3.6 \times 10^7$ ไบต์. หารด้วย $1024^2$: ได้ 34.3 MiB.
- วิดีโอคือลำดับของ frame แบบ bitmap ขนาดที่ไม่ถูกบีบอัดคือหนึ่ง frame $\times$ frame rate $\times$ ระยะเวลา ที่ 30 frames ต่อวินาที $1920 \times 1080$, 24 บิต: $30 \times 1920 \times 1080 \times 24 \approx 1.5 \times 10^9$ บิต ประมาณ 187 MB, ต่อวินาที นั่นคือเหตุผลที่วิดีโอต้องมีการบีบอัดเสมอ

An uncompressed video is $1920 \times 1080$ pixels, 24-bit colour, $30$ frames per second. How many bits does ONE second need? Give the answer to two significant figures, typed like 1.5e9.
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
$1920 \times 1080 \times 24 = 4.98 \times 10^{7}$ bits per frame, times $30$ frames $= 1.5 \times 10^{9}$ bits, about $187\ \text{MB}$ for every second. That is why video is always compressed.
การเปลี่ยนการตั้งค่า
- ลด image resolution: พิกเซลน้อยลง ไฟล์เล็กลงแต่รายละเอียดน้อยลง เมื่อขยายภาพจะดูเป็นบล็อกๆ เพราะแต่ละพิกเซลครอบคลุมหน้าจอมากขึ้น
- ลด colour depth: บิตต่อพิกเซลน้อยลง ไฟล์เล็กลงแต่เฉดสีเรียบจะเกิด banding ซึ่งเป็นขั้นบันไดที่เห็นได้ชัดแทนที่จะเป็น gradient
- เพิ่มขึ้น ของอย่างใดอย่างหนึ่ง: ไฟล์ใหญ่ขึ้นและมีคุณภาพดีขึ้น ตอบโดยใช้คำศัพท์ในหลักสูตรนี้ ไม่ใช่ "รูปภาพแย่ลง"

Match each change to its effect on the image.
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Answer in the syllabus terms, banding and blockiness, not "the picture gets worse".
การเข้ารหัส vector graphic
- vector graphic จัดเก็บ คำสั่ง ในการวาดภาพ เป็น drawing list: รายการที่มีลำดับของ drawing objects ซึ่งเป็น primitives ทางเรขาคณิต เช่น เส้นโค้ง สี่เหลี่ยมผืนผ้า รูปหลายเหลี่ยม และวงกลม
- แต่ละ drawing object มี properties: ตำแหน่งหรือพิกัด สีเส้นและความหนา สีเติม รัศมี ฯลฯ
- เพื่อให้แสดงโปรแกรมจะ render drawing list ตามขนาดที่ต้องการ ดังนั้นจึงสเกลได้โดยไม่สูญเสียคุณภาพ ไม่สามารถอธิบายรายละเอียดพิกเซลแบบสุ่มได้ จึงไม่เหมาะสำหรับภาพถ่าย

รายการของรูปทรงและ properties ของมัน ไม่ใช่ตารางของจุด

A vector logo becomes blurry when you enlarge it a lot.
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Vectors are re-rendered from instructions at any size, so they stay sharp. It is bitmaps that blur when enlarged.
The main advantage of a vector graphic is that it:
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Because it is drawn from instructions, a vector scales without blur — ideal for logos and diagrams (but not photos).
ตัวอย่างวิธีทำ: ให้เหตุผลในการเลือก
- โลโก้ต้องปรากฏบนนามบัตรและป้ายโฆษณา Which format, and why? [3]
- vector graphic เก็บเป็น drawing objects ที่มี properties ดังนั้นโปรแกรมจะ re-render ใหม่ตามขนาดที่ต้องการและขอบจะคมชัด
- Bitmap มีจำนวนพิกเซลคงที่ การขยายไปขนาดป้ายโฆษณาจะทำให้แต่ละพิกเซลมองเห็นได้และโลโก้จะดูเป็นบล็อกๆ
- ส่วนสำหรับภาพถ่าย? bitmap: ภาพถ่ายไม่มีรูปทรงเรขาคณิตที่จะอธิบาย ดังนั้นสีของแต่ละพิกเซลต้องจัดเก็บแยกกัน
Which terms describe how a vector graphic is encoded? Select ทั้งหมด that apply.
ความยาก 2/5 · 140 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
An ordered drawing list of drawing objects, each with properties. Colour depth is a bitmap term, bits per pixel.
การเลือกระหว่างทั้งสอง
| งาน | ตัวเลือก | เหตุผล |
|---|---|---|
| Photograph | bitmap | รายละเอียดระดับพิกเซลไม่สามารถอธิบายเป็นรูปทรงได้ |
| Logo, icon, ป้ายทางถนน | vector | คมชัดทุกขนาด ไฟล์เล็ก |
| Engineering drawing | vector | เรขาคณิตแม่นยำ สเกลได้พอดี |
| Painting, Texture | bitmap | รายละเอียดโทนสีที่ราบรื่นทั่วพื้นที่ |
Which format is better for storing a photograph?
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
A photo has complex per-pixel detail that cannot be described as shapes, so a bitmap is the right choice.
คะแนนที่หลุดหายไป
- ทำงานใน bits, หารด้วย 8 ครั้งเดียว และระบุว่าใช้ 1000 หรือ 1024 การผสม bits และ bytes กึ่งกลางทางมักเป็นการเสียคะแนน
- Image resolution คือพิกเซลของภาพ; screen resolution คือของจอแสดงผล ข้อสอบระบุชื่ออย่างใดอย่างหนึ่ง
- Vector คือ drawing list of objects with properties ไม่ใช่ " picture made of lines" ใช้สามคำนี้
- คำตอบ "justify" ต้องเชื่อมโยง format กับ task: ป้ายโฆษณา หรือ ภาพถ่าย การให้นิยามเพียงอย่างเดียวไม่ได้ justify อะไรเลย
คุณเข้าใจแล้ว
- a bitmap จัดเก็บสีของทุก pixel หลัง file header; image resolution คือขนาดพิกเซล, colour depth คือบิตต่อพิกเซล
- size in bits = width $\times$ height $\times$ colour depth; video เพิ่ม $\times$ frame rate $\times$ duration
- ความละเอียดต่ำทำให้เป็นบล็อก, ความลึกสีต่ำทำให้ banding; ทั้งสองทำให้ไฟล์เล็กลง
- กราฟิกแบบเวกเตอร์ คือ รายการวาดภาพ ของ วัตถุวาดภาพ ที่มี คุณสมบัติ ซึ่งถูก แสดงผล ในขนาดใดก็ได้ ทำให้สามารถปรับขนาดได้โดยไม่สูญเสียคุณภาพ แต่ไม่สามารถจัดเก็บภาพถ่ายได้
เกิดปัญหาอะไรขึ้น? เฉพาะทีมเว็บไซต์เท่านั้นที่เห็นข้อมูลนี้