Posts

Showing posts with the label Conversion

Converting Negative Decimal To Binary

Answer : You're confused because you forgot that there must be something that distinguishes positive numbers from negative ones. Let's say you want to store non-negative numbers on 8 bits. 00000000 is 0, 00000001 is 1, 00000010 is 2, 00000011 is 3, 00000100 is 4, ... 11111111 is 255 So you can store numbers in range 0-255 on 8 bits. 255 = 2 8 - 1. (2 is the base of binary system, 8 is the number of bits, 1 is subtracted because we want to count 0 in) Now, let's say you want to store negative numbers too. How can we achieve that? We can dedicate one bit for sign. If this bit is 0 then we interpret other 7 bits as a positive number, otherwise as a negative number. It's best to use most significant bit for sign because it makes some operations easier. Trivial approach: Just read a number as-is: 00000001 == 1 and 10000001 == -1 01000010 == 66 and 11000010 == -66 01111111 == 127 and 11111111 == -127 Ones' complement: For any number x , negating its bin...

Converting From EPS To SVG Format

Answer : Currently what's working best for me on linux is the following: epstopdf foo.eps pdf2svg foo.pdf foo.svg I believe the first command is a wrapper for ghostscript, and the second is a wrapper for calls to the Poppler and Cairo libraries. On ubuntu, they're in the packages texlive-font-utils and pdf2svg. Gradients come out looking right, but don't seem to be editable in inkscape. I tried using inkscape and uniconverter for this purpose, and as of Jan 2013, both seemed broken when tested on an example containing nothig but some very simple line art. Inkscape throws errors and can't open the eps file. Uniconverter crashes. Scribus and sk1 may work, but seem awkward and not really suited for this task. Uniconvertor is currently the most convenient option. It's a command-line tool that shares code with the sK1 Project. You won't have to bother cropping the image in sK1 if you use uniconvertor, so it's more automated. Run it like this: uniconvertor befo...

Convert Video To Apng/png?

Answer : This sort of thing has been done before (with gif) using imagemagick. APNG is not an official file format - the PNG group doesn't support this extension. Even if you get this to work, you are likely going to have lingering issues. You should probably consider an animated gif, unless you have some reason you are forced to use png. Checkout the page on Video Handling. Also take a look at Animation Basics and Optimization. I appear to be able to convert avi to apng directly on linux, but it fails on windows. A work around on windows would be to convert the movie to a sequence of stills: convert test.avi frame%04d.png if you want to use ffmpeg, this will extract frames every 5 seconds: ffmpeg -i test.avi -y -ss 5 -an -r 1/5 frame%03d.png then making the animation by using the apng edit firefox plugin. mng never gained much support, but APNG apparently has some support these days (FF/Chrome/Safari); more than WebP (Chrome/Opera). Be sure to check for browser support fo...

Converting Djvu To Pdf AND Preserving Table Of Contents , How Is It Possible?

Answer : update: user3124688 has coded up this process in the script dpsprep . I don't know of any tools that will do the conversion for you. You certainly should be able to do it, but it might take a little work. I'll outline the basic process. You'll need the open source command line utilities pdftk and djvused (part of DjVuLibre). These are available from your package manager (GNU/Linux) or their websites (Windows, OS X). step 1: convert the file text First, use any tool to convert the DJVU file to a PDF (without bookmarks). Suppose the files are called filename.djvu and filename.pdf . step 2: extract DJVU outline Next, output the DJVU outline data to a file, like this: djvused "filename.djvu" -e 'print-outline' > bmarks.out This is a file listing the DJVU documents bookmarks in a serialized tree format. In fact it's just a SEXPR, and can be easily parsed. The format is as follows: file ::= (bookmarks <bookmark>*) bookmark...

Converting Epub Files To PDF Format

Answer : You definitely want Calibre. You can use it to convert virtually any file type to any other file type, as long as the source file doesn't have DRM (like Amazon, Adobe, etc.). If it does have DRM, check out Apprentice Alf's blog for help stripping it out with Calibre plugins. Don't use the DRM stripper to pirate books or otherwise violate your agreement with the vendor. Use it so you can enjoy your books on any device in any format. Calibre is also an awesome e-book management program that can do virtually everything. It can manage Kindles, Android phones/tablets, etc. It can even email your books with one click to your Kindle's email address if you want. You won't be disappointed :-) From a terminal: sudo apt-get install calibre Or search for it in Ubuntu Software Center To actually convert the EPUB file you can use the following command: ebook-convert file.epub file.pdf (For details, check this other answer) Or you can check the details for the...