Imagemagick removing watermark - imagemagick

Is it possible to remove watermark placed with imagemagick library in past?
Thanks ;)
Update
I mean, I need to remove my logo from images. Can't find in official documentation, how to remove watermark from image.

Yes, if you restore the original file directory from a backup. I'm presuming that you've rendered a single-layered file, where IM composited/overlayed the watermark on the image. There is no reliable and practical way to remove such a mark generally manually, let alone via batch process. Exceptions might include if the watermark always rendered over a flat color, etc.

The logo can be removed easily using ffmpeg, by using its delogo filter. All you need to supply is the co-ordinates and dimensions of the logo present on the video.
This works on videos very swiftly, you can convert your image to a video and apply this filter, or even compile group of images to a video and later break it into frames to obtain clean images. All of this can be easily done using ffmpeg only.
eg for the filter syntax: ffmpeg -i (your video url) -f "delogo=x=0:y=0:w=100:h=77:band=10" -r (output file url)
Find the complete documentation here.

Related

Ignore known header of video file

i have video uncompressed .avi video files. however they come with a known 2048kb header at the beginning of the file, such that no video program (Vlc player) recognises the file as video files. can i force VLC to ignore the first 2048kb? how?
what would be the easiest way to remove this header?
Unfortunately there is no known to me way of getting vlc to use a larger "probesize" or somehow just skip to byte X.
Also unfortunately there is no known to me way to add some "camouflage" or even add an empty chunk to the front of an avi container. Next approach could be to genereate a reference movie but also no automatic usage tools available at the best of my knowledge. And as there is also no way to just "set or change" the start offset of a file, we have to copy it.
My recommendation for copying parts of files is this sourceforge project: skf
https://sourceforge.net/projects/swissfileknife/?source=typ_redirect
some examples

Web App Image Rotate Issue

Problem:
When uploading image taken from iPhone, it is displayed on the website rotated 90 degrees counter-clockwise. I've done research and understand certain meta data contained in the image file is causing this. Is there a good library to determine if this meta data is in the file and rotate it properly?
My app is build with Laravel and I was looking at Intervention Image to see if maybe that can solve this.
Thanks!
UPDATE:
Still not working. I've checked the php modules and exif and mbstring are enabled on the server.
Here's my code in my laravel controller. The image saves to the directory I specify, but just doesn't orientate properly. Image taken on mobile still shows as rotated on desktop. Thanks!
if (Input::hasFile('profile-image'))
{
$extension = Input::file('profile-image')->getClientOriginalExtension();
$fileName = rand(11111,99999).'.'.$extension;
$image = Image::make(Input::file('profile-image'))->orientate()->save('images/profiles/'.$fileName);
Auth::user()->update([
'image_path' => $fileName,
]);
}
Yes, you'll want the orientate() function it provides.
http://image.intervention.io/api/orientate
Modern cameras add EXIF data to photos that includes the orientation (as well as details about flash, exposure, aperture, etc.). Intervention and other libraries (I've used jhead in the past for autorotation) can use this data.

Modifying JPEG Metadata without Recompressing Image in iOS

I'm trying to use
CGImageSourceCreateWithData
CGImageDestinationCreateWithData
and then
CGImageDestinationAddImageFromSource
but this discards any thumbnails or other embedded information in the original file. What I want to do is read in the file, alter its metadata, and write it out with the alterations only. But I'll settle for reading everything out of it, and putting it back again. Right now a 1.2MB image file gets converted to a 437kB file with the loss of additional data.
Is there something other than CGImage I can use? Can this even be done with the iOS API?
The problem you face is that the structure of the metadata depends upon the specific JPEG file format you are using.
You need to look at CGImageProperties. You're going to have to make sure the properties for your specific file format get copied as well.
What I was looking for was a read-modify-write operation for image files that allowed changes but otherwise maintained unaltered data. I've determined through research and testing that this is not possible in iOS. The closest mechanism available is CGImage processing, but this only allows you to read selected information from a source image (such as image, thumbnail, properties), and then use some of that information (image, properties) to create a new destination file. There's no way to include a thumbnail in the new destination file, and no way to get around recompressing the image.
As of iOS 7 you can use CGImageDestinationCopyImageSource "to modify EXIF and other image metadata in JPEG, PNG, PSD, and TIFF files without recompressing the image data"
https://developer.apple.com/library/archive/qa/qa1895/_index.html

How can I safely remove color scheme profile metadata while generating image preview on server?

User uploads image in browser. On server side I generate preview. I want to remove metadata from preview image. Options:
Remove everything (EXIF, ICC) and save image with the color scheme profile it was uploaded. Is it safe? Will ImageMagic process such images correctly? Will browsers display this properly?
Remove everything and convert the preview to sRGB.
Check ICC color profile and if it is not sRGB - do not remove it.
Any other ideas? Which approach would you reccomend / use in your projects?
Thanks,
The hump you face is dealing with the various forms of JPEG file formats.
In a JFIF file, you could remove all the COM and APPn markers (save APP0), to clean out the metadata and have a readable file.
In an Exif file, APP1 is used in place of JFIF's APP0. However, the EXIF APP1 marker can include metadata.
One thing you could try is to simply strip out all APPn and COM markers. It is likely that many browsers would be able to read JPEG streams without a file format specified and that the would assume a 3 component stream is YCbCr and a 1 component stream is grayscale.
Another solution would be to convert everything to JFIF.

How can I recover PNG images from a .pvr.ccz file?

I have an existing Cocos2D game that uses sprite images taken from a .pvr.ccz file, probably generated by TexturePacker. However, I don't have the original PNG images used to create that file, and I need to make some changes to the images in the game. Are there any tools or techniques that I can use to pull the images out of the .pvr.ccz file, or do I need to write my own tool?
Not possible if they use the encryption option of Texture Packer:
I've added a new feature to TexturePacker which helps you to prevent all this from happening. It's called ContentProtection and simply encrypts the images.
Your app will still be able to decrypt the data, but somebody else is going to have a hard time getting it done.
Source: https://www.codeandweb.com/texturepacker/contentprotection

Resources