LISTING PROGRAM FORM PERTAMA :

  

LISTING PROGRAM

FORM PERTAMA : function varargout = pertama(varargin) gui_Singleton = 1; gui_State = struct( 'gui_Name' , mfilename, ...

  'gui_Singleton' , gui_Singleton, ... 'gui_OpeningFcn' , @pertama_OpeningFcn, ... 'gui_OutputFcn' , @pertama_OutputFcn, ... 'gui_LayoutFcn' , [] , ... 'gui_Callback' , []); if nargin && ischar(varargin{1}) gui_State.gui_Callback = str2func(varargin{1}); end if nargout [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); else gui_mainfcn(gui_State, varargin{:}); end

  % End initialization code - DO NOT EDIT % --- Executes just before pertama is made visible.

  function pertama_OpeningFcn(hObject, eventdata, handles, varargin) % This function has no output args, see OutputFcn.

  % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % varargin command line arguments to pertama (see VARARGIN) % Choose default command line output for pertama

  handles.output = hObject;

  % Update handles structure

  guidata(hObject, handles);

  % UIWAIT makes pertama wait for user response (see UIRESUME) % uiwait(handles.figure1); % --- Outputs from this function are returned to the command line.

  function varargout = pertama_OutputFcn(hObject, eventdata, handles)

  % varargout cell array for returning output args (see VARARGOUT); % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Get default command line output from handles structure

  varargout{1} = handles.output; handles.output = hObject ; handles.citra=imread( 'usu.jpg' ); guidata(hObject, handles); axes(handles.axes1);

  imshow(handles.citra); % --- Executes on button press in button_Proses. function button_Proses_Callback(hObject, eventdata, handles) proses; close pertama ;

  % hObject handle to button_Proses (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % --- Executes during object creation, after setting all properties.

  function axes1_CreateFcn(hObject, eventdata, handles)

  % hObject handle to axes1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: place code in OpeningFcn to populate axes1 % --- Executes on button press in button_bantuan.

  function button_bantuan_Callback(hObject, eventdata, handles) bantuan; close pertama ;

  % hObject handle to button_bantuan (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % --- Executes on button press in button_tentang.

  function button_tentang_Callback(hObject, eventdata, handles)

  % hObject handle to button_tentang (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

  tentang_aplikasi close pertama ;

FORM PROSES :

  function varargout = proses(varargin) gui_Singleton = 1; gui_State = struct( 'gui_Name' , mfilename, ...

  'gui_Singleton' , gui_Singleton, ... 'gui_OpeningFcn' , @proses_OpeningFcn, ... 'gui_OutputFcn' , @proses_OutputFcn, ... 'gui_LayoutFcn' , [] , ... 'gui_Callback' , []); if nargin && ischar(varargin{1}) gui_State.gui_Callback = str2func(varargin{1}); end if nargout [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); else gui_mainfcn(gui_State, varargin{:}); end

  % End initialization code - DO NOT EDIT % --- Executes just before proses is made visible.

  function proses_OpeningFcn(hObject, eventdata, handles, varargin) % This function has no output args, see OutputFcn.

  % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % varargin command line arguments to proses (see VARARGIN) % Choose default command line output for proses

  handles.output = hObject;

  % Update handles structure

  guidata(hObject, handles);

  % UIWAIT makes proses wait for user response (see UIRESUME) % uiwait(handles.figure1); % --- Outputs from this function are returned to the command line.

  function varargout = proses_OutputFcn(hObject, eventdata, handles)

  % varargout cell array for returning output args (see VARARGOUT); % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Get default command line output from handles structure

  varargout{1} = handles.output; % --- Executes on button press in button_pilih. function button_pilih_Callback(hObject, eventdata, handles)

  % hObject handle to button_pilih (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

  global gbrAwal;

  global NamaFile; [filename,pathname] = uigetfile({ '*.bmp;*.jpg' , 'File Gambar (*.bmp,*.jpg)' }, 'Pilih File' ); NamaFile = strcat(pathname, '\' ,filename); [gbrAwal,Map] = imread(NamaFile); axes(handles.axes1); info = imfinfo([pathname,filename]); filesize = info.FileSize / 1024; Flag = isrgb(gbrAwal); if Flag == 1 [b k c] = size(gbrAwal); else [b k] = size(gbrAwal); end Ukuran = [int2str(k) 'x' int2str(b)]; imshow(gbrAwal,Map); set(handles.nama_file, 'String' ,filename); set(handles.uk_file_asli, 'String' ,Ukuran); set(handles.size_asli, 'String' ,filesize); % --- Executes on button press in button_kompresi. function button_kompresi_Callback(hObject, eventdata, handles) start=tic; axes(handles.axes1); gbrAwal=getimage(handles.axes1); [a,b,c]=size(gbrAwal); array=double(gbrAwal); gbrKompresi=zeros(a,b,c); for e=1:a for f=1:b for g=1:c if (mod(array(e,f,g),2)==0) gbrKompresi(e,f,g)=(array(e,f,g))/2; else gbrKompresi(e,f,g)=(array(e,f,g)+1)/2; end end end end gbrHasil=uint8(gbrKompresi); axes(handles.axes2); imshow(gbrHasil); Flag = isrgb(gbrHasil); if Flag == 1 [b k c] = size(gbrHasil); else [b k] = size(gbrHasil); end Ukuran = [int2str(k) 'x' int2str(b)]; finish=toc(start); set(handles.uk_dimensi_kompresi, 'String' ,Ukuran); set(handles.lama_kompresi, 'String' ,finish); set(handles.rasio, 'String' ,rasio); % --- Executes on button press in button_simpan_komp. function button_simpan_komp_Callback(hObject, eventdata, handles)

  % hObject handle to button_simpan_komp (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

  [fileName, pathName] = uiputfile({ '*.bmp' , 'File Bitmap(*.bmp)' , '*.jpg' , 'File JPEG(*.jpg)' }, 'Save Image' ); if isequal([fileName, pathName], [0, 0]) return else result = getimage(handles.axes2); imwrite(result, strcat(pathName, fileName)); info=imfinfo([pathName, fileName]); size_hasil = info.FileSize / 1024 size_asli = str2num(get(handles.size_asli, 'String' )) rasio= (100-(size_hasil/size_asli*100)) set(handles.size_hasil1, 'String' ,size_hasil) set(handles.rasio, 'String' ,rasio) end % --- Executes on button press in button_simpan_dekompresi. function button_simpan_dekompresi_Callback(hObject, eventdata, handles)

  % hObject handle to button_simpan_dekompresi (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

  [fileName, pathName] = uiputfile({ '*.bmp' , 'File Bitmap(*.bmp)' , '*.jpg' , 'File JPEG(*.jpg)' }, 'Save Image' ); if isequal([fileName, pathName], [0, 0]) return else result = getimage(handles.axes3); imwrite(result, strcat(pathName, fileName)); info=imfinfo([pathName, fileName]); size_hasil = info.FileSize / 1024; set(handles.size_hasil2, 'String' ,size_hasil) end % --- Executes on button press in button_waktu_dekompresi. function button_waktu_dekompresi_Callback(hObject, eventdata, handles)

  % hObject handle to button_waktu_dekompresi (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

  global runTimeDekomp; set(handles.lama_dekompresi, 'String' ,runTimeDekomp);

  % --- Executes on button press in button_waktu_kompresi.

  

function button_waktu_kompresi_Callback(hObject, eventdata, handles)

  % hObject handle to button_waktu_kompresi (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % --- Executes on button press in rasio_citra.

  function rasio_citra_Callback(hObject, eventdata, handles)

  % hObject handle to rasio_citra (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % --- Executes on button press in button_dekompresi.

  function button_dekompresi_Callback(hObject, eventdata, handles) start=tic; axes(handles.axes2); gbrHasil=getimage(handles.axes2); [m,n,o]=size(gbrHasil); array=double(gbrHasil); gbrDekomp=zeros(m,n,o); for k=1:o for i=1:m for j=1:n gbrDekomp(i,j,k)=(array(i,j,k))*2; end end end gbrHasil2=uint8(gbrDekomp); axes(handles.axes3); imshow(gbrHasil2) Flag = isrgb(gbrHasil2); if Flag == 1 [b k c] = size(gbrHasil2); else [b k] = size(gbrHasil2); end Ukuran = [int2str(k) 'x' int2str(b)]; set(handles.uk_dimensi_file, 'String' ,Ukuran); finish=toc(start); set(handles.lama_dekompresi, 'String' ,finish);

  %runTimeDekomp = cputime-runTimeDekomp; % --- Executes on button press in button_batal.

  function button_batal_Callback(hObject, eventdata, handles)

  % hObject handle to button_batal (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

  axes(handles.axes1); set(handles.axes1, 'XTick' ,[]); set(handles.axes1, 'YTick' ,[]); % --- Executes on button press in button_Keluar. function button_Keluar_Callback(hObject, eventdata, handles)

  % hObject handle to button_Keluar (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

  selection=questdlg([ 'Keluar Aplikasi ' get(handles.figure1, 'Name' )''], ... [ 'Keluar Aplikasi ' get(handles.figure1, 'Name' )''], ...

  'Ya' , 'Tidak' , 'Ya' ); if strcmp(selection, 'Tidak' ) return ; end delete(handles.figure1) % --- Executes during object creation, after setting all properties. function size_asli_CreateFcn(hObject, eventdata, handles)

  % hObject handle to size_asli (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER.

  if ispc && isequal(get(hObject, 'BackgroundColor' ), get(0, 'defaultUicontrolBackgroundColor' )) set(hObject, 'BackgroundColor' , 'white' ); end function size_hasil1_Callback(hObject, eventdata, handles)

  % hObject handle to size_hasil1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of size_hasil1 as text % str2double(get(hObject,'String')) returns contents of size_hasil1 as a double % --- Executes during object creation, after setting all properties.

  function size_hasil1_CreateFcn(hObject, eventdata, handles)

  % hObject handle to size_hasil1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.

  % See ISPC and COMPUTER.

  get(0, 'defaultUicontrolBackgroundColor' )) set(hObject, 'BackgroundColor' , 'white' ); end function size_hasil2_Callback(hObject, eventdata, handles)

  % hObject handle to size_hasil2 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of size_hasil2 as text % str2double(get(hObject,'String')) returns contents of size_hasil2 as a double % --- Executes during object creation, after setting all properties.

  function size_hasil2_CreateFcn(hObject, eventdata, handles)

  % hObject handle to size_hasil2 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER.

  if ispc && isequal(get(hObject, 'BackgroundColor' ), get(0, 'defaultUicontrolBackgroundColor' )) set(hObject, 'BackgroundColor' , 'white' ); end % --- Executes on button press in button_pertama. function button_pertama_Callback(hObject, eventdata, handles)

  % hObject handle to button_pertama (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

  pertama close proses ;

  % --- Executes on button press in button_bantuan.

  function button_bantuan_Callback(hObject, eventdata, handles)

  % hObject handle to button_bantuan (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

  bantuan close proses ; function size_asli_Callback(hObject, eventdata, handles)

  % hObject handle to size_asli (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

  % Hints: get(hObject,'String') returns contents of size_asli as text size_asli as a double % --- Executes on button press in button_tentang.

  function button_tentang_Callback(hObject, eventdata, handles)

  % hObject handle to button_tentang (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

  tentang_aplikasi close proses ;

  % --- Executes on button press in MSE1.

  function MSE1_Callback(hObject, eventdata, handles)

  % hObject handle to MSE1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) %Baca Gambar Uji

  global gbrAwal;

  %Baca Citra Hasil

  CitraHasil = getimage(handles.axes2); [mseval] = MSE(gbrAwal,CitraHasil); set(handles.nilai_MSE, 'String' ,mseval); % --- Executes on button press in MSE2. function MSE2_Callback(hObject, eventdata, handles)

  % hObject handle to MSE2 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) %Baca Gambar Uji

  global gbrAwal;

  %Baca Citra Hasil

  CitraHasil = getimage(handles.axes3); [mseval] = MSE(gbrAwal,CitraHasil); set(handles.nilai_MSE2, 'String' ,mseval);

FORM BANTUAN :

  function varargout = bantuan(varargin) gui_Singleton = 1; gui_State = struct( 'gui_Name' , mfilename, ...

  'gui_Singleton' , gui_Singleton, ... 'gui_OpeningFcn' , @bantuan_OpeningFcn, ... 'gui_OutputFcn' , @bantuan_OutputFcn, ... 'gui_LayoutFcn' , [] , ... 'gui_Callback' , []); if nargin && ischar(varargin{1}) gui_State.gui_Callback = str2func(varargin{1}); end if nargout [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); else gui_mainfcn(gui_State, varargin{:}); end

  % End initialization code - DO NOT EDIT % --- Executes just before bantuan is made visible.

  function bantuan_OpeningFcn(hObject, eventdata, handles, varargin) % This function has no output args, see OutputFcn.

  % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % varargin command line arguments to bantuan (see VARARGIN) % Choose default command line output for bantuan

  handles.output = hObject;

  % Update handles structure

  guidata(hObject, handles);

  % UIWAIT makes bantuan wait for user response (see UIRESUME) % uiwait(handles.figure1); % --- Outputs from this function are returned to the command line.

  

function varargout = bantuan_OutputFcn(hObject, eventdata, handles)

  % varargout cell array for returning output args (see VARARGOUT); % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Get default command line output from handles structure

  varargout{1} = handles.output; % --- Executes on selection change in listbox1. function listbox1_Callback(hObject, eventdata, handles)

  % hObject handle to listbox1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: contents = get(hObject,'String') returns listbox1 contents as cell array % contents{get(hObject,'Value')} returns selected item from listbox1 % --- Executes during object creation, after setting all properties.

  function listbox1_CreateFcn(hObject, eventdata, handles)

  % hObject handle to listbox1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: listbox controls usually have a white background on Windows. % See ISPC and COMPUTER.

  if ispc && isequal(get(hObject, 'BackgroundColor' ), get(0, 'defaultUicontrolBackgroundColor' )) set(hObject, 'BackgroundColor' , 'white' ); end % --- Executes on button press in pushbutton1. function pushbutton1_Callback(hObject, eventdata, handles)

  % hObject handle to pushbutton1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

  selection=questdlg([ 'Keluar Aplikasi ' get(handles.figure1, 'Name' )''], ... [ 'Keluar Aplikasi ' get(handles.figure1, 'Name' )''], ...

  'Ya' , 'Tidak' , 'Ya' ); if strcmp(selection, 'Tidak' )

  return ; delete(handles.figure1) % --- Executes on button press in pushbutton2. function pushbutton2_Callback(hObject, eventdata, handles)

  % hObject handle to pushbutton2 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

  pertama close bantuan ;

  % --- Executes on button press in pushbutton3.

  function pushbutton3_Callback(hObject, eventdata, handles)

  % hObject handle to pushbutton3 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

  proses close bantuan ;

  % --- Executes on button press in button_tentang.

  function button_tentang_Callback(hObject, eventdata, handles)

  % hObject handle to button_tentang (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

  tentang_aplikasi close bantuan ;

FORM TENTANG APLIKASI :

  function varargout = tentang_aplikasi(varargin) gui_Singleton = 1; gui_State = struct( 'gui_Name' , mfilename, ...

  'gui_Singleton' , gui_Singleton, ... 'gui_OpeningFcn' , @tentang_aplikasi_OpeningFcn, ...

  'gui_OutputFcn' , @tentang_aplikasi_OutputFcn, ... 'gui_LayoutFcn' , [] , ... 'gui_Callback' , []); if nargin && ischar(varargin{1}) gui_State.gui_Callback = str2func(varargin{1}); end if nargout [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); else gui_mainfcn(gui_State, varargin{:}); end

  % End initialization code - DO NOT EDIT % --- Executes just before tentang_aplikasi is made visible.

  function tentang_aplikasi_OpeningFcn(hObject, eventdata, handles, varargin) % This function has no output args, see OutputFcn.

  % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % varargin command line arguments to tentang_aplikasi (see

  VARARGIN)

  % Choose default command line output for tentang_aplikasi

  handles.output = hObject;

  % Update handles structure

  guidata(hObject, handles);

  % UIWAIT makes tentang_aplikasi wait for user response (see UIRESUME) % uiwait(handles.figure1); % --- Outputs from this function are returned to the command line.

  

function varargout = tentang_aplikasi_OutputFcn(hObject, eventdata,

handles)

  % varargout cell array for returning output args (see VARARGOUT); % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Get default command line output from handles structure

  varargout{1} = handles.output; % --- Executes on button press in button_keluar. function button_keluar_Callback(hObject, eventdata, handles)

  % hObject handle to button_keluar (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % --- Executes on button press in button_proses.

  function button_proses_Callback(hObject, eventdata, handles)

  % hObject handle to button_proses (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

  proses close tentang_aplikasi

  % --- Executes on button press in button_pertama.

  function button_pertama_Callback(hObject, eventdata, handles)

  % hObject handle to button_pertama (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

  pertama close tentang_aplikasi ;

  % --- Executes on button press in button_bantuan.

  function button_bantuan_Callback(hObject, eventdata, handles)

  % hObject handle to button_bantuan (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

  bantuan close tentang_aplikasi ;

  Nama : Winda Dian Luca Hsb Tempat/Tanggal Lahir : Medan, 17 Juli 1991 Agama : Islam Alamat Sekarang : Jl. Sei Mencirim gang. Ingat No.4c Kp.lalang 20352 Alamat Orang Tua : Jl. Sei Mencirim gang. Ingat No.4c Kp.lalang 20352 Telp/ Hp : 081375200208 Email : windadianluca@gmail.com

Riwayat Pendidikan

  2009 – 2013 : S1 Ilmu Komputer Universitas Sumatera Utara, Medan 2006 – 2009 : SMA Swasta Al-Azhar Medan 2003 – 2006 : SMP Negeri 1 Medan 1997 – 2003 : SD Swasta Kartika Jaya Medan

Pengalaman Organisasi dan Kegiatan Ilmiah

   Komputer (IMILKOM), 2010-2011 Praktek Kerja Lapangan di Bank Sumut Medan, Juli-Agustus 2012 

  Anggota Departemen Hubungan Masyarakat Ikatan Mahasiswa S1 Ilmu