-=-
.
.....
  
 
RSS
Direkomendasikan menggunakan brower Opera/Chrome/Firefox. Resolusi minimal 1024x768 | Powered by ____ |
 
  
 
Nikmati Delphi-ID dalam berbagai versi tampilan :
Basic View (LOW Bandwidth)
Default View (Full)
Mobile Edition
Main Menu
..:: onWebTools ::..
..:: onLastPosts ::..
goto Postjumlah komponen maksimal dalam sebuah project(6)
 by d4mnf1y32
 on 21.May at 12:16
goto Posttanya grayscale to biner dengan scanline(1)
 by luckynvic
 on 20.May at 20:44
goto Posttanya looping biner to matriks(1)
 by luckynvic
 on 20.May at 20:10
goto Postsql error:acces denied for user....(2)
 by nasbms
 on 19.May at 16:54
goto Postpemanggilan frame(4)
 by nasbms
 on 19.May at 16:14
goto Posttanya AvLock(0)
 by azuriza
 on 19.May at 11:24
goto PostGet TDBEdit Value Menggunakan LookUp Grid(10)
 by henry_sys
 on 18.May at 11:27
goto Postmenghitung record dalam perulangan(4)
 by idhiel
 on 16.May at 13:53
goto Posttanya ascii(4)
 by mas_kofa
 on 16.May at 12:11
goto PostRawPrint Untuk Delphi XE2(0)
 by adewijaya
 on 15.May at 22:34
goto Postdatabase error..(4)
 by idhiel
 on 15.May at 15:57
goto Postbekasi, pt arila putra mahkota(3)
 by mas_kofa
 on 15.May at 15:37
goto Postbagaimana cara membaca file *.doc dg delphi?(0)
 by ficky
 on 15.May at 06:14
goto Posttanya biner to matriks(13)
 by diandewi
 on 14.May at 20:30

..:: onLast Articles ::..
..:: New Download ::..
Pascal-id.Org
Feeds -  Popular -  Latest
RE: The Longue
8 months, 3 weeks ago
RE: belajar pascal
8 months, 3 weeks ago
RE: The Longue
8 months, 3 weeks ago
RE: belajar pascal
8 months, 3 weeks ago
RE: Perkenalan dan Absen
8 months, 3 weeks ago
RE: Alhamdulillah Buka Puasa Bersama
8 months, 3 weeks ago
RE: تَقَبَّلَ اللهُ مِنَّا وَمِنْكَ - Selamat Hari Raya Idul Fitri
8 months, 3 weeks ago
Lintas Situs
«
free web site stats and visitor tracking

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
wasqtoOffline
Location:
22 Post subject: convert gambar dr 24bit jadi 1 bit  PostPosted: 19/Jun/2006 12:50



Joined: 15-Jun-2006
Posts: 1

Status: Offline
haloo teman2 yang jago2 delphi...saya anggota baru nihh...
saya mau bikin tugas kuliah. salah satunya untuk meng-convert gambar dari 24 bit / true colors jadi gambar 1 bit alias black/white. gimana caranya yah??

mohon bantuannya...

thanx a lot!!
 
 View user's profile Send private message  
Reply with quote Back to top
sukuguciOffline
Location:
1 Post subject: Covert graphic 24 to 1bit  PostPosted: 20/Jun/2006 21:57
onIntermediate


Joined: 28-Jan-2006
Posts: 49

Status: Offline
coba kamu baca buku rinaldi munir terbitan informatika bandung tentang pengolahan algoritma pengolahan citra dengan bahasa pengantar C++. Prisip nya sederhana, semua pixel dengan intensitas 0(hitam) sampai dengan (2^24)/2 akan dijadikan hitam atau 0 dan diatas itu jadi putih atau 1.
 
 View user's profile Send private message  
Reply with quote Back to top
pebbieOffline
Location: di dapur
Post subject:   PostPosted: 19/Jan/2007 10:48
onUber-Skilled


Joined: 16-Sep-2006
Posts: 459
Location: di dapur
Status: Offline
just for information.

binerisasi gambar true color terjadi dua tahap :
- konversi ke format intensitas (greyscale) . ada beberapa cara : bisa sekedar rata-rata komponen r, g, dan b (setiap komponen koefisiennya 1). atau dengan koefisien tertentu untuk tiap r, g, dan b.
- tresholding : konversi greyscale (256 tingkat intensitas) ke biner (2 tingkat intensitas). ditentukan nilai tertentu sebagai ambang (t) jika intensitas suatu pixel lebih besar atau sama dengan t maka pixel tersebut diset ke maksimum (biner 1), dan minimum jika lebih kecil dari nilai ambang t (biner 0)
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
LeonardoOffline
Location:
Post subject:   PostPosted: 28/Feb/2008 11:58
onBeginner


Joined: 28-Feb-2008
Posts: 4

Status: Offline
Aku uda nyoba cara konversi dari pf24bit ke pf1bit,(untuk conversi dari RGB->grascale->biner)tapi ketika uda jadi biner warna yang ada koq bukan putih hitam yah?...tapi malah hitam dan coklat (tanpa function), tapi klo aq pisah jadi function sendiri koq malah jadi biru sama hitam ya...tlg Rolling Eyes
 
 View user's profile Send private message Yahoo Messenger  
Reply with quote Back to top
pebbieOffline
Location: di dapur
Post subject:   PostPosted: 28/Feb/2008 12:57
onUber-Skilled


Joined: 16-Sep-2006
Posts: 459
Location: di dapur
Status: Offline
masalahnya bukan pada TBitmap, tapi pada komponen penampilnya (TImage).
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
LeonardoOffline
Location:
Post subject:   PostPosted: 03/Mar/2008 10:40
onBeginner


Joined: 28-Feb-2008
Posts: 4

Status: Offline
ini cupilikan function yang aku bikin, dan tolong di koreksi kalo ada yang salah ya...

code : pascal
  1. function grayscaling(var gbrIn:TBitmap):TBitmap;
  2. Var
  3. GbrTmp:TBitmap;
  4. //GbrTmpTinggi,GbrTmpLebar:Cardinal;
  5. Bheight,Bwidth,i,j,c,GrayVal,GrayValCount :Cardinal;
  6. pixArrRGB,pixArrGrey:pbytearray;
  7. gbrOut:TBitmap;
  8. Begin
  9. GbrTmp:=TBitmap.Create;
  10. GbrIn.PixelFormat:=pf24bit;
  11. Try
  12. With GbrTmp Do
  13. Begin
  14. PixelFormat:=pf24bit;
  15. Height:=gbrIn.Height;
  16. Width:=gbrIn.Width;
  17. End;
  18. for i:=0 to gbrIn.height-1 do
  19. begin
  20. pixArrRGB:=gbrIn.ScanLine[i];
  21. pixArrGrey:=GbrTmp.ScanLine[i];
  22. for j:=0 to gbrIn.width-1 do
  23. begin
  24. GrayVal:=round((pixArrRGB[j*3]) * 0.11{Blue my Man!!}) round((pixArrRGB[j*3 1]) * 0.59{Green Cing!}) round((pixArrRGB[j*3 2]) * 0.3{MERAH Euy!});
  25. pixArrGrey[j*3]:= GrayVal;
  26. pixArrGrey[j*3 1]:= GrayVal;
  27. pixArrGrey[j*3 2]:= GrayVal;
  28. GrayValCount:=GrayValCount GrayVal;//**
  29. c:=c 1; //**
  30. end
  31. end;
  32. GbrTmp.PixelFormat:=pf8bit;
  33. grayscaling:=GbrTmp;
  34. Finally
  35. //GbrTmp.Free;
  36. End;
  37. End;
  38.  
  39. function binerisasi(var gbrIn:TBitmap):TBitmap;
  40. Var
  41. GbrTmp:TBitmap;
  42. GbrTmpTinggi,GbrTmpLebar:Cardinal;
  43. Bheight,Bwidth,i,j,c,GrayVal,GrayValCount :Cardinal;
  44. pixArrBin,pixArrGrey:pbytearray;
  45. gbrOut:TBitmap;
  46. Begin
  47. GbrTmp:=TBitmap.Create;
  48. GbrIn.PixelFormat:=pf8bit;
  49. Try
  50. With GbrTmp Do
  51. Begin
  52. PixelFormat:=pf1bit;
  53. Height:=gbrIn.Height;
  54. Width:=gbrIn.Width;
  55. End;
  56. for i:=0 to gbrIn.height-1 do
  57. begin
  58. pixArrGrey:=gbrIn.ScanLine[i];
  59. pixArrBin:=GbrTmp.ScanLine[i];
  60. for j:=0 to gbrIn.width-1 do
  61. begin
  62. if pixArrGrey[j]>=128then
  63. begin
  64. pixArrBin[j div 8]:=1;
  65. //gbrOut.Canvas.Pixels[i,j]:=255;
  66. //pixArrBin[j*3 1]:= 255;
  67. //pixArrBin[j*3 2]:= 255;
  68. end
  69. else
  70. pixArrBin[j div 8]:= 0;//ColorToRGB(clBlack);;
  71. //gbrOut.Canvas.Pixels[i,j]:=0;
  72. //pixArrBin[j*3 1]:= 0;
  73. //pixArrBin[j*3 2]:= 0;
  74. end
  75. end;
  76. binerisasi:=GbrTmp;
  77. Finally
  78. //GbrTmp.Free;
  79. End;
  80.  
  81. End;
Parsed in 0.026 seconds, using GeSHi


nah sekarang yang jadi masalah kenapa koq setelah berhasil bikin warnanya hitam putih, koq pixel yang kedetect lompat2 ya....
hasilnya mungkin kyk gini<br>
 
 View user's profile Send private message Yahoo Messenger  
Reply with quote Back to top
betamax
Location:
Post subject:   PostPosted: 03/Mar/2008 16:42
onUber-Skilled


Joined: 17-May-2007
Posts: 263

coba mas periksa kembali kordinat piksel yang dirubah warnanya...
apa sudah sama dengan piksel asal ?? terutama pada for i:=0 to gbrIn.height-1 do ...

Smile

_________________
-|[ H-412-RY]|-
 
 View user's profile Send private message  
Reply with quote Back to top
pebbieOffline
Location: di dapur
Post subject:   PostPosted: 04/Mar/2008 09:46
onUber-Skilled


Joined: 16-Sep-2006
Posts: 459
Location: di dapur
Status: Offline
code : pascal
  1. for j:=0 to gbrIn.width-1 do
  2. begin
  3. if pixArrGrey[j]>=128then
  4. begin
  5. pixArrBin[j div 8] := pixArrBin[j div 8] or (1 shl j mod "modules/PNphpBB2/images/smiles/icon_cool.gif" alt="Cool" border="0" />;
  6. end
  7. else
  8. pixArrBin[j div 8] := pixArrBin[j div 8] or (0 shl j mod "modules/PNphpBB2/images/smiles/icon_cool.gif" alt="Cool" border="0" />;
  9. end
Parsed in 0.007 seconds, using GeSHi
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
pebbieOffline
Location: di dapur
Post subject:   PostPosted: 04/Mar/2008 09:51
onUber-Skilled


Joined: 16-Sep-2006
Posts: 459
Location: di dapur
Status: Offline
eh salah.. yang black itu harusnya
code : pascal
  1. pixArrBin[j div 8] := pixArrBin[j div 8] and not (1 shl j mod "modules/PNphpBB2/images/smiles/icon_cool.gif" alt="Cool" border="0" />;
Parsed in 0.003 seconds, using GeSHi
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
LeonardoOffline
Location:
Post subject:   PostPosted: 06/Mar/2008 11:35
onBeginner


Joined: 28-Feb-2008
Posts: 4

Status: Offline
terima kasih atas saran mas-mas semua.... setelah beberapa lama ...saya kembali ke prinsip awal programming...yaitu..."Manusia harus bisa ngakali mesin... " Razz ,sy telah berhasil mencoba konversi kemaren tetapi tidak menggunakan cara dari mas2 yang mas2 sarankan kemaren.., saya langsung mencoba untuk menembak tiap pixelnya dan langsung saya set jadi 0 dan 1..., dan ternyata malah berhasil...


oya...saya pengen tau kalo untuk bisa mengetahui resolusi screen scr otomatis gmn caranya yah?....THX
 
 View user's profile Send private message Yahoo Messenger  
Reply with quote Back to top
pebbieOffline
Location: di dapur
Post subject:   PostPosted: 06/Mar/2008 14:57
onUber-Skilled


Joined: 16-Sep-2006
Posts: 459
Location: di dapur
Status: Offline
caranya gimana? bagi-bagi juga dong di sini.. sapa tau lain waktu ada yang membutuhkan..
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
betamax
Location:
Post subject:   PostPosted: 06/Mar/2008 15:11
onUber-Skilled


Joined: 17-May-2007
Posts: 263

get desktop bisa, atau desktop.width / desktop.height

If Dekstop.width = 1024 and dekstop.height = 768 then ShowMessages('Resolusi Layar = 1024 x 768');
Di otak atik sendiri coba..

_________________
-|[ H-412-RY]|-
 
 View user's profile Send private message  
Reply with quote Back to top
LeonardoOffline
Location:
Post subject:   PostPosted: 12/Mar/2008 11:14
onBeginner


Joined: 28-Feb-2008
Posts: 4

Status: Offline
Buat Mas Pebbie....sesegera mungkin sy posting source-nya...,berhubung hr ni bru ada masalah ni di-storage Server ....mw buka explorer ae...susahnya minta ampoun.....,apalagi buka Flashdisk

meskipun kmrn sy uda brhasil....tp kmrn saya ttp masih penasaran....dan sy tahu knp kemaren perubahan pixel nya lompat - lompat, ternyata yang bermasalah adalah di "[j div 8]", krn increment yang ada kn tidak smua_nya klipatan 8, perubahan yang terjadi hanya pada nilai index yg brklipatan 8,dan kmudian saya nyoba ngakali aja....dengan ngubah nilai index ttp "[j]" tnp dibagi 8, kmudian untuk pengubahan gambarNya, gbrTmp yg ada di function kmrn nilai pixelFormat-nya saya samakan dengan pixelFormat dari bitmap yang masuk, kmudian baru ketika akan dipassing keluar...sy biarkan biar Delphi yang mengkonversi pixelFormat-nya, nah kali ini sy yakin hasil akhirnya sudah 1bit...tp muncul masalah yang sama dgn peristiwa pertama dlu....yaitu warna yang muncul bukan hitam/putih tapi hitam/merah(tapi saya sudh yakin kalo gambar yang keluar sudah bnr2 1bit, karena dlm nilai index scanline-nya(pByteArray-nya, sudah bisa dimasukkan nilai semisal langsung 0 atau 1)), contohnya misal: pixArrBin[j]:=1, sudah langsung mau, tanpa muncul "errorException:Scanline index Out of Range"....wah skg msh bnr2 penasaran...apakah mas2 ada yang tau sebabnya?..., ataukah saya perlu meng-oprak2 sistem palette-nya ya...,skali lagi..., scepat mungkin akan saya posting source-nya agar mas2 tahu maksud permasalahan yang saya alami.... Crying or Very sad,
 
 View user's profile Send private message Yahoo Messenger  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 12 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic





Powered by PNphpBB2 © 2003-2009 The Zafenio Team
Credits


| Register | Lost Password ? |