Make image transparent in ruby - ruby

I was wondering if anyone could suggest to me potential libraries in ruby for manipulating jpegs? Specifically I want to make the image 50% transparent so it can act as an overlay. The image in question would be of a house and I'd like it to overlay a village image.
Just being specific about the image as the transforms may not like multiple colours :)

Take a look at RMagick. This tutorial features transparency/opacity.
Best wishes,
Fabian

Check out RMagick

Related

Identify logos on PNG without AI Services

So, I don't believe that exists someway to "read" a PNG through its binary code, or something like that, but I have zero knowledge on Image Processing or Computer Vision, and so, I can't be sure if that are ways to do it or not.
To be clear: I want to know if there are ways to identify the image of a Logo using an image of the Logo as reference but through methods that use only the binary of the image.
Thanks in advance
If the logo is known, and not distorted a lot (logo printed on a scarf is not as good as on a flat surface), there is technologies that can achieve that:
It is a template matching problem, see https://docs.opencv.org/4.5.2/d4/dc6/tutorial_py_template_matching.html.

Magento resize with gd2 bad image

i have problems to obtain good thumb from some images, when the original images are striped or checked shirt.
With the magento's gd2 library resize() in Varien_Image_Adapter_Gd2 class (magento 1.5 version) i obtain an image with a strange effect that modify the aspect of real image.
I can't find the name of this effect, so i can't search this issue on google! :(
You can see my issue in these 2 images:
As you can see, on the thumb image there are some rolling strange lines in particular in top-left position.
The issue is more evident on checked shirt, so i have to find a solution to correct this.
If anyone have some tips on this issue, please said me! :)
thx
Luca
'Moire' is the pattern you describe and it is particularly visible due to use of 'gd2' library which may or may not use bicubic scaling.
I am not sure that #Guerra has understood the problem here, but, to me, it is a straightforward lack of bicubic (or better) scaling.
See the answer on this question and follow the link:
https://stackoverflow.com/a/255666/1617149
So you may want to scale your images for the frontend using imagemagick instead of the standard gd2 library that comes with Magento and use a filter.
You can run imagemagick through php (the proper way), or, if you have complicated image processing on the go, you can go commandline 'exec' and prototype your image processing that way. I don't have any ready-to-roll code for that, however, that is what you need: better thumbnail rendering than you get with gd2.
Try use cloudzoom, he autosize your images to fit on your needs.
http://ecommerce-team.com/cloud-zoom.html

Automatically color balance images

Is there a way in Ruby to automatically color-balance images that are uploaded to my Ruby on Rails app?
It seems like a lot of the images I'm uploading are too dark and I'd like to normalize all my images to be equally bright if possible, rather than simply making every image brighter. If some image is sufficiently bright, it should not be changed.
I would use rmagick. Take a look at the modulate method, perhaps that would help.

Matlab: Image stitching and blending

Hey guys. I got two images from video frames. They have a certain portion of overlap. After warping one of them, I'm currently trying to blend them together. In other words, I would like to stitch them together. But I don't know how to accomplish that. Can anybody please give me some help? Thank you!
Let's say the image data is store in 'image1_warped' and 'image2'. Appreciated your help!
The keyword here is Image Registration. The Image Processing Toolbox provides some functions for this purpose. The documentation has a some of demos as examples.
Checkout the blog post: Blend images with MATLAB,
with nice examples, and the MATLAB code.
Where the two images join apply the Photoshop clone tool (vary the percentage of opacity and size as required)

How does facebook handle resizing of images

Hello I am building a social network similar to facebook and I really need some help on how to handle the images in my website. I would like to know how sites like facebook manage the resizing of their images. An example would be looking at someones photo album. The length and width are not just simply changed. They are done in a more professional way to make the image still look clear and not stretched. Do they use a special tool for this. Another example would be profile pics when they are loaded to your message wall. Your friends profile pics are centered and cropped accordingly and then re sized. How do they go about doing this. Any help would be greatly appreciated.
They resize proportionally with an imaging library like GD, Imagick or others.
The presentation in the gray area is just that, presentation so HTML and CSS.
They stretch the images proportionally so that they don't look wrong; if you make the image 37.5% wider... you also make it 37.5% taller.
If we knew what language you are familiar with, we could probably suggest something to help with this.

Resources