Click here to Skip to main content
15,881,863 members
Articles / Programming Languages / C#
Article

Converting image files to OTA file format (Mobile Picture Message)

Rate me:
Please Sign up or sign in to vote.
3.81/5 (21 votes)
8 Jul 2005 197.6K   5.9K   26   35
A simple code for converting image files to OTA file format (Mobile Picture Message).

Introduction

I searched the internet for a program to convert the image files to the OTA file format, but there was none!!! So, I began researching for OTA file format details... finally, I wrote a program with C# to do this...

The source code and binary files are ready for download...

The main logic of this program is an algorithm for converting images. Mobile picture messages (OTA or OTB files) have a standard size: 72x28. First of all we must create a file (*.ota) and then write 4 standard bytes into it.

byte0 -> 0000 0000 (0)
byte1 -> 0100 1000 (72)
byte2 -> 0001 1100 (28)
byte3 -> 0000 0001 (1)

Now read image, pixel by pixel, from left to right and top to bottom, every 8 pixel makes a byte for writing to the file:

black pixels = 0
Other pixels = 1

An image with size 72x28:

has 72*28 = 2016 (bits)
every 8 bits = 1 byte => 2016 / 8 = 252
and 252(bytes) + 4(standard bytes) = 256 bytes

Finally, the file size is 256 bytes.

Download and read my source code to see this program working...

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Software Developer (Senior)
Iran (Islamic Republic of) Iran (Islamic Republic of)
Alireza Naghizadeh

Comments and Discussions

 
Questionhi Pin
mohamad milaki7-Sep-11 2:08
mohamad milaki7-Sep-11 2:08 
AnswerRe: hi Pin
Alireza Naghizadeh7-Sep-11 18:31
Alireza Naghizadeh7-Sep-11 18:31 
GeneralThank's - Saber Hayati Pin
bazyrayaneh15-Jun-11 12:15
bazyrayaneh15-Jun-11 12:15 
Generalwant a program in java to convert .jpg image into .ota format Pin
shoaib_bagwan8-Sep-09 22:50
shoaib_bagwan8-Sep-09 22:50 
GeneralRe: want a program in java to convert .jpg image into .ota format Pin
prabha vd15-Sep-10 19:19
prabha vd15-Sep-10 19:19 
Generalhi, Pin
prashant.patel31@gmail.com13-Apr-09 2:22
prashant.patel31@gmail.com13-Apr-09 2:22 
GeneralRe: hi, Pin
musyab17-Apr-09 21:10
musyab17-Apr-09 21:10 
GeneralHello Sir Pin
oviyaa16-Feb-09 18:03
oviyaa16-Feb-09 18:03 
QuestionHow to send pic msgs (.ota) By Nokia E51 ? Pin
undead_fred11-Nov-08 2:45
undead_fred11-Nov-08 2:45 
AnswerRe: How to send pic msgs (.ota) By Nokia E51 ? Pin
Alireza Naghizadeh11-Nov-08 4:18
Alireza Naghizadeh11-Nov-08 4:18 
GeneralTrouble with creating picture msg with my n70 Pin
Nikhil Dhotre15-Jul-08 6:44
Nikhil Dhotre15-Jul-08 6:44 
GeneralRegarding OTA Pin
Muthuganesh12-Jul-08 1:44
Muthuganesh12-Jul-08 1:44 
Hello,
i am not able to view the OTA file is there any specific software to view that filewill you???

Thanks in advance
GeneralSending OTA file via SMPP protocol to NOKIA SMSC Pin
Iftee17-Jan-08 2:51
Iftee17-Jan-08 2:51 
GeneralAbout OTA file Pin
Ta Hoang Van9-Jan-08 14:58
Ta Hoang Van9-Jan-08 14:58 
GeneralRe: About OTA file Pin
venki_pandi3-Feb-08 22:57
venki_pandi3-Feb-08 22:57 
GeneralNeed more idea Pin
tykea_khy11-Dec-07 16:38
tykea_khy11-Dec-07 16:38 
GeneralSend Picture SMS as 1 SMS ( instead of conventional 3 SMS) Pin
Night Safari3-Nov-07 22:33
Night Safari3-Nov-07 22:33 
GeneralRe: Send Picture SMS as 1 SMS ( instead of conventional 3 SMS) Pin
style of worlds19-Jan-08 21:12
style of worlds19-Jan-08 21:12 
QuestionFor this .OTAfile i have to instal any software in my mobile? Pin
Narendra Mahalik24-Aug-07 1:56
Narendra Mahalik24-Aug-07 1:56 
AnswerRe: For this .OTAfile i have to instal any software in my mobile? Pin
Alireza Naghizadeh9-Sep-07 4:48
Alireza Naghizadeh9-Sep-07 4:48 
Questionhow to send image ? Pin
Shakeel Mumtaz10-Jun-07 18:58
Shakeel Mumtaz10-Jun-07 18:58 
AnswerRe: how to send image ? Pin
adnaneco18-Apr-09 19:13
adnaneco18-Apr-09 19:13 
GeneralRe: how to send image ? Pin
Shakeel Mumtaz19-Apr-09 19:47
Shakeel Mumtaz19-Apr-09 19:47 
GeneralRe: how to send image ? Pin
adnaneco20-Apr-09 2:54
adnaneco20-Apr-09 2:54 
GeneralPicture message Pin
teznin5-Jan-07 1:14
teznin5-Jan-07 1:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.