I have one huge logo with dimensions 1770x1770 and need to scale it down to 80x80. The logo is not complicated and shouldn't loose quality but when I scale it down, it looks really bad, quality is drastically decreased and text is not readable at all.
I know that beginning dimensions look huge but the logo is simple so it should be possible to keep good quality.
The best results which I had were when I was scaling the image in a couple of phases by 20-30%.
Thoughts? Thank you :)
It is of the nature of raster images they cannot change size with impunity.
If you have your logo in a vector format, like SVG, or postscript, you better use another program to generate a low resolution version of it.
Otherwise, if the original is raster, them one way to try to reduce it is to downscale it a bit of a time (around 10%), and run enhance-filters at each step. It will yield you a better result, but still far from perfect.
You can do that programatically - open up a Python console in filters->python->console
Then, retrieve a reference to your image with:
img = gimp.image_list()[0] (the 0 ) referes to the last image tab open - use "1" for the one before that, and so on.
And them just type:
while img.width > 80:
pdb.gimp_image_scale(img, int(img.width * 0.9), int(img.height * 0.9))
pdb.plug_in_unsharp_mask(img, img.layers[0], 3, 0.5, 4)
(If you know nothing about Python: beware of the identation - the two lines inside the while must have a common whitespace prefix - and hit in a blank line to actually execute it)
Related
So, I need a tool that will pick a random color from an image and give me the hex code for it. In specific, from an image of a 4-point gradient. I'm hoping to be able to make it so that I can load any image (by pasting in a link) and using said image, but if I have to code for a specific image edit the code each time I need a different one, that's okay too.
My thought was taking the image and randomizing between the height and width in pixels, and then selecting that pixel and getting the hex code of it, which would then be output. However, being fairly new to coding, I haven't found anything from searching online that would let me do something like this.
I have played around in JS fiddle for a few hours, and I can get it to load an image from the web, but the actual selection of a pixel isn't something I can figure out, although I assume it's possible with so many javascript color-pickers out there.
If there's an easier way to do this with a different type of code, I'm completely open to it, I just need to be pointed in the right direction. Thanks everyone!
Coming back to say I figured this out. What I had been looking for (as far as javascript goes, anyway,) was converting my image to base64 and then using that to get the pixels from. Then it was just a matter of randomizing between image height and image width, and selecting the corresponding pixel.
x = Math.floor(Math.random() * img.width+1);
y = Math.floor(Math.random() * img.height+1);
I'm sure this code isn't amazing, as I relied heavily on other people's code to figure out what I was doing, but in case it helps anyone this is what the end result looks like:
http://jsfiddle.net/AmoraChinchilla/qxh6mr9u/40/
I'm trying to do image comparison to detect changes in a video processing application. These are two images that look identical to me, but are different according to both
http://pdiff.sourceforge.net/
and http://www.itec.uni-klu.ac.at/lire/nightly/api/net/semanticmetadata/lire/imageanalysis/LireFeature.html
Can anyone explain the difference? Eventually I need to find a library that can detect differences that doesn't have any false positives.
The two images are different.
I used GIMP (open source) to stack the two images one on top of the other and do a difference for the top layer. It showed a very faint black image, i.e. very little difference. I then used Curve to raise the tones and it revealed that what seem to be JPEG artifacts, even though the files given are PNG. I recommend GIMP and sometimes I use it instead of Photoshop.
Using GIMP to do a blink comparison between layers at 400% view, I would guess that the first image is closer to the original. The second may be saved copy of the first or from the original but saved at a lower quality setting.
It seems that the metadata has been stripped off both images (haven't done a definitive look), so no clues there.
There was a program called Unique Filer that I used for years. It is tunable and rather good. But any comparator is likely to generate a number of false positives if you tune it well enough to make sure it doesn't miss duplicates. If you only want to catch images that are very similar like this pair, then you can tune it very tightly. It is old and may not work on Windows 7 or later.
I would like to find good image checkers / comparators too. I've considered writing my own program.
I am using MYSQL workbench to generate an EER diagram, and to the best of my knowledge, one can not control the dimensions of the canvas, only the size in number of pages. This has the result that you get a huge amount of white space around your diagram, making it nearly unusable. Why anyone would design it this way is beyond me. There are a lot of questions which ask how to crop a pdf, but they are either more complicated (ie. crop to a certain dimension, or crop and output to different format and ratio) or they do not preserve the image quality, or they just plain do not work. My question therefore is this:
How does one create or convert an EER diagram using MySQL Workbench such that there are no white borders AND the image quality is preserved?
Note I asked the question here as it pertains to databasing, but apologies if it is in the wrong place.
Looks like what you are after is a way to limit the output of an image export to a relatively small area, so that it fits nicely in another document. Several options are possible:
1) Export as png and simply cut off the unwanted parts. Depending on the further usage this might be good enough.
2) Export as SVG and use any of the SVG editors to limit the image size to the wanted area only. Then convert it to the format you need in your target document.
3) Set a paper size in the model that encompasses the content as close as possible. E.g. the statement paper type is quite small. Then rearrange your objects. Resize them if you need larger ones. By setting a larger font (via Preferences) you should be able to make the entire appearence larger. Then export as PDF.
I have a Flash file that I need to reduce the size of.
The reason that I need to reduce its size is that I will need to convert this into an iPhone app.
currently it only has 2 buttons and 2 TLF textfileds on the stage one, layer one and the size of the file is 355KB.
I have also placed the code on layer 2.
is there anyway to reduce the size of it so I won't have problems when publishing and sending for app store?
Thanks
The biggest portion of that file size will be related to TLF. TLF (Text-Layout-Framework) is huge and is generally not recommended on mobile (as it has pretty high cpu usage).
If you're not using any TLF specific features, then it would be wise to change your text fields to use classic text instead (DF3).
Beyond TLF, make sure you're using vector objects instead of bitmaps wherever you can as that will drastically reduce file size. If you are using bitmaps, you can play around with the compression settings to optimize file size further. You can do this globally in the Publish Settings (JPEG Quality) or individually on a graphics properties menu.
One note with Vector graphics and mobile, simple vectors will run ok, but complex vectors will run terribly. Make sure to set cacheAsBitmap = true; on any complex (or even all) vectors to improve performance. OR in FLashPRO, click on a movieClip and in the properties panel, go to the "Display" twirl down, and set cache as bitmap in the Render setting.
I made patterns: images with the "A" letter of different sizes (from 12 to 72: 12, 14, .., 72)
And I tested the method of pattern matching and it gave a good results.
One way to select text regions from image is to run that algorithm for all small and big letters and digits of different sizes. And fonts!
I don't like it. Instead of it I want to make something like a universal pattern or
better to say: scanning image with different window sizes and select those regions where some function (probability of that there is a character at that window) is more than some fixed value.
Do you know any methods or ideas to make that function?
It must work with original image (grayscale).
I suppose you are developing OCR, right?
You decided to go quite unusual way since everyone else do matching on bi-tonal images. This makes everything much simplier. Once you degradated it properly (which is very difficult task by itself), you do not have to deal with different brightness levels, take care about uneven background, etc. And sure, less computation resources needed. However, is doing everything in grayscale is actually your goal and you want to show other OCR scientists that it is actually doable - well, I wish you good luck then.
Approach of letters location you described is very-very-very computation intesive. You have to scan whole image (image_size^2), then match with pattern ( * pattern_size^2) and then do it for each pattens ( * pattern_num ). This will be incredibly slow.
Instead try to simplify your algorithm to break it to two stages. First should look for some features on picture (like connected dark regions, or split image on large squares and throw away all light ones) and only then perform pattern matching on small number of found areas. This is all at least N^2, and you could try to reduce complexity to working on rows or columns of image first (by creating histogram). So there is a lot of different simplification methods you can try to play with.
After you have located those objects on picture and going to match patterns on them, you actually know their size, so you don't have to store letter A in all sizes, you can just rescale original image of object to the size say 72, and match it.
As to fonts - you don't really have much choice here, you will need to match against all possible shapes of A to make sure you found A. But once you match against just one size of A - you have more computing power to try different A's.