file-conversion

“Standard” RGB to Grayscale Conversion

让人想犯罪 __ 提交于 2019-11-30 06:57:10
问题 I'm trying to write a converters algorithm that takes a JPEG image and returns its PGM (Portable Gray Map) version. The problem is that I can't understand how the "official" JPG->PGM convertitors work in terms of what value to assign to the final pixel (i guess, 0->255) starting from the classic RGB format. At the beginning, I used this formula (it's the same used by OpenCV's CV_RGB2GRAY conversion): 0.30*R + 0.59*G + 0.11*B = val I wrote a simple code to test my results: it takes a color

Command-line tool for converting TTF/OTF fonts to SVG

孤街醉人 提交于 2019-11-30 05:08:05
Does anyone know of a command-line tool that will convert both TTF and OTF fonts to SVG fonts? Erik Dahlström You can use fontforge or batik to do this from the commandline. With fontforge (see scripting documentation ): #!/usr/bin/fontforge Open($1) Generate($1:r + ".svg") Save the above to convert2svgfont.pe file, then invoke as: convert2svgfont.pe myfont.ttf For batik see this documentation , install and then invoke as: java -jar batik-ttf2svg.jar myfont.ttf -o myfont.svg The fontforge recipe given previously by @Erik no longer works - fontforge has switched to Python scripting. Here's how

How to convert PDF to HTML?

蓝咒 提交于 2019-11-30 03:43:47
Is there a proper library which I can use to convert PDF to HTML or some other format that can be converted to HTML easily? I searched similar questions, but to no luck. I want to be able to extract text from PDF's, possibly images. I'm not looking to embed the PDF inside the HTML. Like I mentioned in the comment above, it is definitely possible to convert pdf to html using the tool Able2Extract7 which can be downloaded from here I have been using this tool for almost 2 years now and I am pretty happy with it. This tool lets you convert PDF to Word, Excel, PowerPoint, Publisher, HTML , OO etc.

How to convert .Rdata format into text file format

荒凉一梦 提交于 2019-11-30 02:08:00
问题 I am a novice in R and I am trying to convert .Rdata format file into comma delimited text file format. Can someone help me out regarding this? 回答1: load("yourData.RData") ls() #returns a list of all the objects you just loaded (and anything else in your environment) write.csv(theItemOfInterestFromYourDRadataFileAsThereMayBeMoreThanOneThingInthere, file="yourCSV.csv") 回答2: An .RData file can contain more than 1 object of any class. If your file contains more than 1 object of data.frame -like

Convert XHTML to Word ML

99封情书 提交于 2019-11-29 22:12:16
问题 What is the best way to convert word HTML to word XML? I cannot buy a tool so need something preferably XSLT which is free and works suitably with basic formatting like paragraphs, lists, bold and italic. 回答1: Stephane Bouillon wrote a blog about this over on MSDN. She supplies a pretty good xslt transform that will do the job. It is designed for use with InfoPath, and only supports the XHTML tags InfoPath will produce so you may need to modify it for your specific application. But it seems

Command-line tool for converting TTF/OTF fonts to SVG

会有一股神秘感。 提交于 2019-11-29 02:57:08
问题 Does anyone know of a command-line tool that will convert both TTF and OTF fonts to SVG fonts? 回答1: You can use fontforge or batik to do this from the commandline. With fontforge (see scripting documentation): #!/usr/bin/fontforge Open($1) Generate($1:r + ".svg") Save the above to convert2svgfont.pe file, then invoke as: convert2svgfont.pe myfont.ttf For batik see this documentation, install and then invoke as: java -jar batik-ttf2svg.jar myfont.ttf -o myfont.svg 回答2: The fontforge recipe

iOS Code to Convert m4a to WAV

心已入冬 提交于 2019-11-29 02:46:44
Does anyone have any code snippets that show how to convert an M4a file to WAV? I know there are libraries that convert the other way around. Thanks. Just to update for Swift 3: func convertAudio(_ url: URL, outputURL: URL) { var error : OSStatus = noErr var destinationFile: ExtAudioFileRef? = nil var sourceFile : ExtAudioFileRef? = nil var srcFormat : AudioStreamBasicDescription = AudioStreamBasicDescription() var dstFormat : AudioStreamBasicDescription = AudioStreamBasicDescription() ExtAudioFileOpenURL(url as CFURL, &sourceFile) var thePropertySize: UInt32 = UInt32(MemoryLayout.stride

How to convert PDF to HTML?

余生长醉 提交于 2019-11-29 00:49:08
问题 Is there a proper library which I can use to convert PDF to HTML or some other format that can be converted to HTML easily? I searched similar questions, but to no luck. I want to be able to extract text from PDF's, possibly images. I'm not looking to embed the PDF inside the HTML. 回答1: Like I mentioned in the comment above, it is definitely possible to convert pdf to html using the tool Able2Extract7 which can be downloaded from here I have been using this tool for almost 2 years now and I

wav-to-midi conversion

情到浓时终转凉″ 提交于 2019-11-28 20:52:09
I'm new to this field - but I need to perform a WAV-to-MIDI conversion in java. Is there a way to know what exactly are the steps involved in WAV-to-MIDI conversion? I have a very rough idea as in you need to; sample the wav file, filter it, use FFT for spectral analysis, feature extraction and then write the extracted features on to MIDI. But I cannot find solid sources or papers as in how to do all that? Can some one give me clues as in how and where to start? Are there any Open Source APIs available for this WAV-to-MIDI conversion process? Advance thanks It's a more involved process than

Recover PDF to LaTeX [closed]

橙三吉。 提交于 2019-11-28 18:45:47
I know how make a PDF from LaTeX. Is there a way to extract the LaTeX-code from a PDF I created earlier? How about if someone sends me a PDF and I like the formatting. Can I extract the LaTeX from it? LaTeX does not have a one-to-one conversion to PDF. With regards to your first question, I believe such a conversion may be technically possible, but I do not believe an application to do so yet exists. Similar to the way assembler can be decompiled back into high level language, there is probably a way to do it. However -- a pdf is allowed to contain all matter of kinds of data -- AutoCAD