Grayscale Dengan Vb.net.docx

  • Uploaded by: Hotland Sitorus
  • 0
  • 0
  • May 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Grayscale Dengan Vb.net.docx as PDF for free.

More details

  • Words: 183
  • Pages: 1
Grayscale dengan VB.Net Peningkatan kualitas citra dapat dilakukan melalui tranformasi intensitas citra, yaitu besar intensitas setiap pixel pada citra diubah tetapi posisi pixel tetap. Transformasi ini dapat dilakukan dengan sebuah fungsi transformasi skala keabuan grayscale tranformation function (GST) RGB 2 Grayscale Citra Warna Dapat diubah menjadi citra grayscale dengan cara menghitung rata-rata elemen warna:

contoh:

contoh program menggunakan vb.net bmap = New Bitmap(picAwal.Image) 'Gambar asli dijadikan gambar Bitmap picAwal.Image = bmap Dim tempbmp As New Bitmap(picAwal.Image) 'deklarasi gambar Bitmap dari gambar asli untuk diproses Dim Red As Integer, Green As Integer, Blue As Integer, Grey As Integer Dim X, Y As Integer With tempbmp For X = 0 To .Height - 1 For Y = 0 To .Width - 1 Red = CInt(.GetPixel(Y, X).R) 'ambil nilai warna merah (Red) pada pixel(Y,X) Green = CInt(.GetPixel(Y, X).G) 'ambil nilai warna hijau (Green) pada pixel(Y,X) Blue = CInt(.GetPixel(Y, X).B) 'ambil nilai warna biru (Blue) pada pixel(Y,X) Grey = (Red + Green + Blue) / 3 'konversi warna pada pixel Y,X ke grey bmap.SetPixel(Y, X, Color.FromArgb(Grey, Grey, Grey)) 'simpan warna baru pada pixel(Y,X) Next Next End With

Related Documents


More Documents from ""